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
- HelpEvent.cs
- TypeUtil.cs
- ExportOptions.cs
- OutputCacheProfile.cs
- ExpandedProjectionNode.cs
- CodeTypeOfExpression.cs
- SystemResourceKey.cs
- _SecureChannel.cs
- ChangePassword.cs
- OneOfTypeConst.cs
- ScriptBehaviorDescriptor.cs
- FlagsAttribute.cs
- WMICapabilities.cs
- WebPartCancelEventArgs.cs
- VirtualPathProvider.cs
- SystemUnicastIPAddressInformation.cs
- StateDesigner.cs
- NavigationPropertyEmitter.cs
- TextEndOfParagraph.cs
- AutoGeneratedField.cs
- XamlBrushSerializer.cs
- MainMenu.cs
- CatalogZone.cs
- ServiceEndpointAssociationProvider.cs
- WinCategoryAttribute.cs
- HyperLinkField.cs
- NullRuntimeConfig.cs
- TrailingSpaceComparer.cs
- ObjectViewQueryResultData.cs
- GPPOINTF.cs
- Range.cs
- ConnectionConsumerAttribute.cs
- ContextProperty.cs
- ControlBindingsCollection.cs
- cookiecollection.cs
- MessageDecoder.cs
- DataExchangeServiceBinder.cs
- AsyncOperationManager.cs
- RSAPKCS1SignatureFormatter.cs
- StatusBar.cs
- SetMemberBinder.cs
- FontFamily.cs
- ActivityTypeDesigner.xaml.cs
- LiteralControl.cs
- CodeSubDirectoriesCollection.cs
- TypeConverters.cs
- Encoding.cs
- CapabilitiesState.cs
- ClrPerspective.cs
- MailDefinition.cs
- OpenTypeCommon.cs
- ProxyGenerator.cs
- SupportsEventValidationAttribute.cs
- Literal.cs
- PackageDigitalSignature.cs
- ObjectListItem.cs
- OleDbRowUpdatedEvent.cs
- RowToFieldTransformer.cs
- Serializer.cs
- HttpContext.cs
- CircleHotSpot.cs
- XhtmlCssHandler.cs
- PersonalizationStateInfoCollection.cs
- Scripts.cs
- DataServiceProcessingPipeline.cs
- FrameworkContentElement.cs
- BmpBitmapEncoder.cs
- CodeMemberMethod.cs
- PrivilegeNotHeldException.cs
- TracingConnectionInitiator.cs
- Type.cs
- ToolBar.cs
- AuthenticateEventArgs.cs
- BamlTreeMap.cs
- FixedHighlight.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- PickBranchDesigner.xaml.cs
- FailedToStartupUIException.cs
- Property.cs
- SystemFonts.cs
- Command.cs
- InvalidateEvent.cs
- IntSecurity.cs
- DataGridTable.cs
- ColorAnimation.cs
- Identity.cs
- ContainerUtilities.cs
- ConnectionModeReader.cs
- BitmapMetadataEnumerator.cs
- DataControlFieldHeaderCell.cs
- SqlLiftWhereClauses.cs
- TypeProvider.cs
- HtmlElementCollection.cs
- SequentialWorkflowHeaderFooter.cs
- __FastResourceComparer.cs
- DrawItemEvent.cs
- EntityContainerRelationshipSet.cs
- EnumerableWrapperWeakToStrong.cs
- Peer.cs
- FrameAutomationPeer.cs