Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / System / Diagnostics / CorrelationManager.cs / 1 / CorrelationManager.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Specialized; using System.Threading; using System.Runtime.Remoting.Messaging; namespace System.Diagnostics { public class CorrelationManager { private const string transactionSlotName = "System.Diagnostics.Trace.CorrelationManagerSlot"; private const string activityIdSlotName = "E2ETrace.ActivityID"; internal CorrelationManager() { } public Guid ActivityId { get { Object id = CallContext.LogicalGetData(activityIdSlotName); if (id != null) return (Guid) id; else return Guid.Empty; } set { CallContext.LogicalSetData(activityIdSlotName, value); } } public Stack LogicalOperationStack { get { return GetLogicalOperationStack(); } } public void StartLogicalOperation(object operationId) { if (operationId == null) throw new ArgumentNullException("operationId"); Stack idStack = GetLogicalOperationStack(); idStack.Push(operationId); } public void StartLogicalOperation() { StartLogicalOperation(Guid.NewGuid()); } public void StopLogicalOperation() { Stack idStack = GetLogicalOperationStack(); idStack.Pop(); } private Stack GetLogicalOperationStack() { Stack idStack = CallContext.LogicalGetData(transactionSlotName) as Stack; if (idStack == null) { idStack = new Stack(); CallContext.LogicalSetData(transactionSlotName, idStack); } return idStack; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Specialized; using System.Threading; using System.Runtime.Remoting.Messaging; namespace System.Diagnostics { public class CorrelationManager { private const string transactionSlotName = "System.Diagnostics.Trace.CorrelationManagerSlot"; private const string activityIdSlotName = "E2ETrace.ActivityID"; internal CorrelationManager() { } public Guid ActivityId { get { Object id = CallContext.LogicalGetData(activityIdSlotName); if (id != null) return (Guid) id; else return Guid.Empty; } set { CallContext.LogicalSetData(activityIdSlotName, value); } } public Stack LogicalOperationStack { get { return GetLogicalOperationStack(); } } public void StartLogicalOperation(object operationId) { if (operationId == null) throw new ArgumentNullException("operationId"); Stack idStack = GetLogicalOperationStack(); idStack.Push(operationId); } public void StartLogicalOperation() { StartLogicalOperation(Guid.NewGuid()); } public void StopLogicalOperation() { Stack idStack = GetLogicalOperationStack(); idStack.Pop(); } private Stack GetLogicalOperationStack() { Stack idStack = CallContext.LogicalGetData(transactionSlotName) as Stack; if (idStack == null) { idStack = new Stack(); CallContext.LogicalSetData(transactionSlotName, idStack); } return idStack; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SkipQueryOptionExpression.cs
- RijndaelManagedTransform.cs
- SplitterCancelEvent.cs
- CommandValueSerializer.cs
- SignatureHelper.cs
- Axis.cs
- EventHandlersStore.cs
- ProxyHelper.cs
- WebPartDescriptionCollection.cs
- HttpProfileGroupBase.cs
- BitmapEffectCollection.cs
- MessageQueueAccessControlEntry.cs
- BitmapMetadata.cs
- SolidColorBrush.cs
- SourceChangedEventArgs.cs
- PointLightBase.cs
- XmlQueryType.cs
- ScrollChangedEventArgs.cs
- WinFormsUtils.cs
- Point3D.cs
- XPathNodeIterator.cs
- SqlFormatter.cs
- OleDbWrapper.cs
- ExceptionHandler.cs
- FormViewDesigner.cs
- GridViewItemAutomationPeer.cs
- OleDbParameter.cs
- KeyFrames.cs
- ModifierKeysValueSerializer.cs
- CounterSample.cs
- Journal.cs
- XmlSchemaSet.cs
- TcpServerChannel.cs
- XmlTypeMapping.cs
- NotifyCollectionChangedEventArgs.cs
- HttpConfigurationSystem.cs
- Buffer.cs
- IMembershipProvider.cs
- TypeToken.cs
- PriorityItem.cs
- SafeSecurityHandles.cs
- ADMembershipUser.cs
- MultipartIdentifier.cs
- StrongTypingException.cs
- LabelInfo.cs
- ResponseBodyWriter.cs
- WindowsButton.cs
- ThrowOnMultipleAssignment.cs
- Decimal.cs
- ComplexType.cs
- CombinedGeometry.cs
- TdsParserStateObject.cs
- WindowsTokenRoleProvider.cs
- TextRangeEditTables.cs
- HierarchicalDataTemplate.cs
- Table.cs
- XPathMultyIterator.cs
- RecognizedWordUnit.cs
- FloatMinMaxAggregationOperator.cs
- OutputBuffer.cs
- DbDeleteCommandTree.cs
- TextBoxRenderer.cs
- SecurityDocument.cs
- GPPOINT.cs
- ToolStripDropTargetManager.cs
- ModelFactory.cs
- PropertyValidationContext.cs
- SkewTransform.cs
- DependencyProperty.cs
- PropertyValue.cs
- LinqDataSourceView.cs
- DesignerVerbCollection.cs
- NameSpaceEvent.cs
- MeasurementDCInfo.cs
- BinaryConverter.cs
- HtmlLink.cs
- ConditionalAttribute.cs
- MultiView.cs
- DataGridViewEditingControlShowingEventArgs.cs
- HwndAppCommandInputProvider.cs
- FormsAuthenticationConfiguration.cs
- CorePropertiesFilter.cs
- Rect3D.cs
- CommandEventArgs.cs
- Image.cs
- UriScheme.cs
- FilteredAttributeCollection.cs
- WebPart.cs
- Model3DGroup.cs
- MatchingStyle.cs
- PointLightBase.cs
- TdsParserSafeHandles.cs
- Rect3D.cs
- FirstQueryOperator.cs
- WpfKnownType.cs
- DrawToolTipEventArgs.cs
- PersistenceTypeAttribute.cs
- XmlDictionary.cs
- DbProviderFactoriesConfigurationHandler.cs
- BinHexEncoding.cs