Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / Trace / Activity.cs / 1305376 / Activity.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Transactions.Diagnostics { using System; internal class Activity : IDisposable { Guid oldGuid; Guid newGuid; bool emitTransfer = false; bool mustDispose = false; Activity(ref Guid newGuid, bool emitTransfer) { this.emitTransfer = emitTransfer; if (DiagnosticTrace.ShouldCorrelate && newGuid != Guid.Empty) { this.newGuid = newGuid; this.oldGuid = DiagnosticTrace.GetActivityId(); if (oldGuid != newGuid) { this.mustDispose = true; if (this.emitTransfer) { DiagnosticTrace.TraceTransfer(newGuid); } DiagnosticTrace.SetActivityId(newGuid); } } } internal static Activity CreateActivity(Guid newGuid, bool emitTransfer) { Activity retval = null; if (DiagnosticTrace.ShouldCorrelate && (newGuid != Guid.Empty) && (newGuid != DiagnosticTrace.GetActivityId())) { retval = new Activity(ref newGuid, emitTransfer); } return retval; } public void Dispose() { if (this.mustDispose) { this.mustDispose = false; if (this.emitTransfer) { DiagnosticTrace.TraceTransfer(oldGuid); } DiagnosticTrace.SetActivityId(oldGuid); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Transactions.Diagnostics { using System; internal class Activity : IDisposable { Guid oldGuid; Guid newGuid; bool emitTransfer = false; bool mustDispose = false; Activity(ref Guid newGuid, bool emitTransfer) { this.emitTransfer = emitTransfer; if (DiagnosticTrace.ShouldCorrelate && newGuid != Guid.Empty) { this.newGuid = newGuid; this.oldGuid = DiagnosticTrace.GetActivityId(); if (oldGuid != newGuid) { this.mustDispose = true; if (this.emitTransfer) { DiagnosticTrace.TraceTransfer(newGuid); } DiagnosticTrace.SetActivityId(newGuid); } } } internal static Activity CreateActivity(Guid newGuid, bool emitTransfer) { Activity retval = null; if (DiagnosticTrace.ShouldCorrelate && (newGuid != Guid.Empty) && (newGuid != DiagnosticTrace.GetActivityId())) { retval = new Activity(ref newGuid, emitTransfer); } return retval; } public void Dispose() { if (this.mustDispose) { this.mustDispose = false; if (this.emitTransfer) { DiagnosticTrace.TraceTransfer(oldGuid); } DiagnosticTrace.SetActivityId(oldGuid); } } } } // 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
- StrokeNode.cs
- SqlDuplicator.cs
- SymbolTable.cs
- AsymmetricKeyExchangeFormatter.cs
- MsmqDecodeHelper.cs
- wgx_render.cs
- SplashScreenNativeMethods.cs
- PropertyConverter.cs
- GeometryGroup.cs
- ClientReliableChannelBinder.cs
- XPathSelectionIterator.cs
- ReadWriteSpinLock.cs
- DeclarativeCatalogPartDesigner.cs
- SqlStatistics.cs
- X509IssuerSerialKeyIdentifierClause.cs
- Unit.cs
- IDictionary.cs
- TraceData.cs
- GeneratedView.cs
- HtmlInputButton.cs
- StringFormat.cs
- FlowDocumentPaginator.cs
- MobileListItem.cs
- TraceContextRecord.cs
- ScrollBar.cs
- InitializerFacet.cs
- SqlWebEventProvider.cs
- XmlSchemaAttributeGroupRef.cs
- PixelFormats.cs
- XPathBuilder.cs
- VirtualizingStackPanel.cs
- SafeLibraryHandle.cs
- DispatcherOperation.cs
- CollectionCodeDomSerializer.cs
- LocatorManager.cs
- BlobPersonalizationState.cs
- EntryPointNotFoundException.cs
- TextBoxView.cs
- Win32KeyboardDevice.cs
- DataGridViewAccessibleObject.cs
- BitmapImage.cs
- XmlSignatureProperties.cs
- Switch.cs
- RuleSetReference.cs
- SiteMembershipCondition.cs
- Track.cs
- XmlSchemaFacet.cs
- ProofTokenCryptoHandle.cs
- AlphaSortedEnumConverter.cs
- EventToken.cs
- SignatureToken.cs
- TextProperties.cs
- FocusTracker.cs
- FileSystemInfo.cs
- bindurihelper.cs
- ETagAttribute.cs
- XDRSchema.cs
- HtmlToClrEventProxy.cs
- DataGridCell.cs
- recordstatescratchpad.cs
- RuleSettings.cs
- EmbeddedObject.cs
- HttpInputStream.cs
- OrderedDictionary.cs
- GridViewSelectEventArgs.cs
- BitmapScalingModeValidation.cs
- RequestQueryProcessor.cs
- InfoCardMasterKey.cs
- ClockController.cs
- Ray3DHitTestResult.cs
- MissingMemberException.cs
- SqlDataSourceCommandEventArgs.cs
- PeerTransportBindingElement.cs
- MaskDescriptors.cs
- SHA256CryptoServiceProvider.cs
- SystemIcmpV6Statistics.cs
- StyleSheetRefUrlEditor.cs
- EntitySetBaseCollection.cs
- FrameworkEventSource.cs
- Debugger.cs
- BaseTreeIterator.cs
- CodeMemberField.cs
- InternalConfigConfigurationFactory.cs
- PrintDialog.cs
- Automation.cs
- ZipIOFileItemStream.cs
- ListBox.cs
- _Rfc2616CacheValidators.cs
- UpnEndpointIdentityExtension.cs
- GeneralTransform2DTo3DTo2D.cs
- HostedTcpTransportManager.cs
- CriticalFileToken.cs
- ZipIOCentralDirectoryBlock.cs
- UpdateInfo.cs
- InlineUIContainer.cs
- LinkGrep.cs
- HttpRequestMessageProperty.cs
- VBIdentifierName.cs
- OleDbEnumerator.cs
- PackageStore.cs