Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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; } } }
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CompModSwitches.cs
- IconBitmapDecoder.cs
- SchemaDeclBase.cs
- EntityViewGenerationAttribute.cs
- InternalBufferOverflowException.cs
- SizeConverter.cs
- HttpPostLocalhostServerProtocol.cs
- DesignerView.xaml.cs
- PanelContainerDesigner.cs
- EndEvent.cs
- Font.cs
- GradientBrush.cs
- CatalogPartChrome.cs
- ResourceManagerWrapper.cs
- AccessibilityHelperForXpWin2k3.cs
- ContentPresenter.cs
- SqlFunctionAttribute.cs
- CriticalFileToken.cs
- XmlEncodedRawTextWriter.cs
- EditorPartCollection.cs
- BuildProvidersCompiler.cs
- ParameterElement.cs
- Pkcs9Attribute.cs
- DuplexClientBase.cs
- RequestCachePolicy.cs
- _AutoWebProxyScriptHelper.cs
- ObjRef.cs
- NameScopePropertyAttribute.cs
- MediaSystem.cs
- LingerOption.cs
- ItemList.cs
- SingleResultAttribute.cs
- MultiPropertyDescriptorGridEntry.cs
- RadioButtonFlatAdapter.cs
- ObjectHandle.cs
- ExpressionVisitor.cs
- Vector3dCollection.cs
- IndexerNameAttribute.cs
- HideDisabledControlAdapter.cs
- TiffBitmapDecoder.cs
- XmlStreamStore.cs
- ListGeneralPage.cs
- MethodImplAttribute.cs
- COM2Properties.cs
- ListSortDescription.cs
- Utils.cs
- NetworkInformationPermission.cs
- CodeTypeReference.cs
- XmlBinaryReaderSession.cs
- BrowserDefinition.cs
- DataSourceNameHandler.cs
- PointKeyFrameCollection.cs
- ProbeMatchesMessageCD1.cs
- WebPartVerb.cs
- EdmItemCollection.cs
- DataSourceSerializationException.cs
- SendMessageChannelCache.cs
- SafeBitVector32.cs
- _BufferOffsetSize.cs
- VSWCFServiceContractGenerator.cs
- ExeContext.cs
- SafeLibraryHandle.cs
- FontSizeConverter.cs
- IsolationInterop.cs
- Array.cs
- MissingMethodException.cs
- X509ThumbprintKeyIdentifierClause.cs
- WeakRefEnumerator.cs
- TemplateControl.cs
- FrameworkElement.cs
- ToolStripOverflowButton.cs
- Constraint.cs
- DictionaryMarkupSerializer.cs
- WebEventCodes.cs
- InvariantComparer.cs
- FileSystemWatcher.cs
- HtmlAnchor.cs
- EpmSourceTree.cs
- NativeMethods.cs
- CompilerErrorCollection.cs
- ISAPIWorkerRequest.cs
- HtmlInputButton.cs
- TraceData.cs
- PointUtil.cs
- followingsibling.cs
- TextFormatterImp.cs
- _SecureChannel.cs
- ProxyManager.cs
- RowSpanVector.cs
- AddInAttribute.cs
- DataKeyArray.cs
- DbConnectionFactory.cs
- SchemaTableColumn.cs
- ToolStripTextBox.cs
- UniqueIdentifierService.cs
- Site.cs
- DataGridViewButtonColumn.cs
- ContextProperty.cs
- XmlNodeChangedEventManager.cs
- VerificationAttribute.cs