Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / RunTime / WorkflowTraceTransfer.cs / 1305376 / WorkflowTraceTransfer.cs
using System; using System.IO; using System.Threading; using System.Diagnostics; ////// Summary description for Class1 /// namespace System.Workflow.Runtime { internal class WorkflowTraceTransfer: IDisposable { Guid oldGuid; bool transferBackAtClose; public WorkflowTraceTransfer(Guid instanceId) { this.oldGuid = Trace.CorrelationManager.ActivityId; if (!this.oldGuid.Equals(instanceId)) //Avoid redundant transfers. { WorkflowTrace.Runtime.TraceTransfer( 0, null, instanceId ); Trace.CorrelationManager.ActivityId = instanceId; WorkflowTrace.Runtime.TraceEvent(TraceEventType.Start, 0, "Workflow Trace"); this.transferBackAtClose = true; } } #region IDisposable Members public void Dispose() { if (this.transferBackAtClose) { WorkflowTrace.Runtime.TraceTransfer( 0, null, oldGuid ); WorkflowTrace.Runtime.TraceEvent(TraceEventType.Stop, 0, "Workflow Trace"); Trace.CorrelationManager.ActivityId = oldGuid; } } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.IO; using System.Threading; using System.Diagnostics; ////// Summary description for Class1 /// namespace System.Workflow.Runtime { internal class WorkflowTraceTransfer: IDisposable { Guid oldGuid; bool transferBackAtClose; public WorkflowTraceTransfer(Guid instanceId) { this.oldGuid = Trace.CorrelationManager.ActivityId; if (!this.oldGuid.Equals(instanceId)) //Avoid redundant transfers. { WorkflowTrace.Runtime.TraceTransfer( 0, null, instanceId ); Trace.CorrelationManager.ActivityId = instanceId; WorkflowTrace.Runtime.TraceEvent(TraceEventType.Start, 0, "Workflow Trace"); this.transferBackAtClose = true; } } #region IDisposable Members public void Dispose() { if (this.transferBackAtClose) { WorkflowTrace.Runtime.TraceTransfer( 0, null, oldGuid ); WorkflowTrace.Runtime.TraceEvent(TraceEventType.Stop, 0, "Workflow Trace"); Trace.CorrelationManager.ActivityId = oldGuid; } } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TransformerInfoCollection.cs
- VisualState.cs
- Select.cs
- ProfilePropertySettings.cs
- Ref.cs
- dbenumerator.cs
- securitycriticaldataClass.cs
- AnnotationObservableCollection.cs
- WebPartEditorApplyVerb.cs
- shaperfactoryquerycacheentry.cs
- ProgressBarAutomationPeer.cs
- documentsequencetextcontainer.cs
- SqlInfoMessageEvent.cs
- QilLoop.cs
- BitmapPalette.cs
- TailCallAnalyzer.cs
- PersonalizationProvider.cs
- ListBoxDesigner.cs
- DemultiplexingClientMessageFormatter.cs
- TextProperties.cs
- DesignerView.cs
- DBDataPermissionAttribute.cs
- DefinitionUpdate.cs
- Collection.cs
- ObjectContext.cs
- DesignerCategoryAttribute.cs
- ViewDesigner.cs
- InvalidOleVariantTypeException.cs
- Message.cs
- Point3DCollection.cs
- GridViewEditEventArgs.cs
- MethodToken.cs
- RightNameExpirationInfoPair.cs
- Int16AnimationBase.cs
- WmlObjectListAdapter.cs
- VirtualPathData.cs
- RowCache.cs
- IIS7UserPrincipal.cs
- LineGeometry.cs
- CreateUserWizardStep.cs
- RepeaterItemEventArgs.cs
- DocumentSequence.cs
- LinqMaximalSubtreeNominator.cs
- iisPickupDirectory.cs
- MethodAccessException.cs
- TypeBrowser.xaml.cs
- RightsManagementEncryptionTransform.cs
- AppearanceEditorPart.cs
- WebRequestModuleElement.cs
- UpdatePanelTrigger.cs
- DataSet.cs
- webproxy.cs
- TextDecorationCollection.cs
- TextTreeRootNode.cs
- ObjectViewListener.cs
- XMLUtil.cs
- EventLog.cs
- BooleanKeyFrameCollection.cs
- EmptyQuery.cs
- ProtocolsConfiguration.cs
- Link.cs
- MasterPageParser.cs
- InternalMappingException.cs
- DispatcherHookEventArgs.cs
- GifBitmapEncoder.cs
- DodSequenceMerge.cs
- AsyncOperationContext.cs
- ColorDialog.cs
- BinaryMethodMessage.cs
- AssemblyCollection.cs
- DateTimePicker.cs
- XmlQualifiedName.cs
- CryptoConfig.cs
- FixedLineResult.cs
- ApplicationInfo.cs
- AudioBase.cs
- ApplicationFileParser.cs
- RawKeyboardInputReport.cs
- SoapFaultCodes.cs
- AmbientLight.cs
- SafeHandles.cs
- TraceFilter.cs
- streamingZipPartStream.cs
- ObjectDataSourceView.cs
- DiscoveryOperationContextExtension.cs
- TextBlock.cs
- GroupAggregateExpr.cs
- SqlWebEventProvider.cs
- DataGridSortCommandEventArgs.cs
- ParameterElementCollection.cs
- Vector3DAnimationUsingKeyFrames.cs
- ErrorInfoXmlDocument.cs
- OdbcParameterCollection.cs
- PrtCap_Base.cs
- XmlSignatureProperties.cs
- TimeoutHelper.cs
- documentation.cs
- GenericUI.cs
- ParallelLoopState.cs
- EventManager.cs