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
- SortExpressionBuilder.cs
- RegexCode.cs
- ObjectQueryExecutionPlan.cs
- JsonGlobals.cs
- OdbcHandle.cs
- IsolatedStorageFilePermission.cs
- CodeAccessPermission.cs
- OdbcRowUpdatingEvent.cs
- MetadataUtilsSmi.cs
- TagPrefixCollection.cs
- TypeUnloadedException.cs
- PropertyDescriptors.cs
- AsymmetricKeyExchangeFormatter.cs
- ChtmlTextWriter.cs
- ActivationServices.cs
- NamespaceList.cs
- DoubleConverter.cs
- DragDeltaEventArgs.cs
- OdbcPermission.cs
- DateTimeFormatInfoScanner.cs
- figurelengthconverter.cs
- FixedSOMTextRun.cs
- DataTemplateSelector.cs
- ImageSource.cs
- WhitespaceRuleReader.cs
- TypeDescriptorFilterService.cs
- CodeCatchClause.cs
- RuleConditionDialog.Designer.cs
- TableLayoutStyle.cs
- SynchronizedInputHelper.cs
- BuildManager.cs
- COM2FontConverter.cs
- DecimalAnimationBase.cs
- DataGridCaption.cs
- CodeParameterDeclarationExpressionCollection.cs
- MultiPropertyDescriptorGridEntry.cs
- BitmapSizeOptions.cs
- EditBehavior.cs
- PeerApplication.cs
- _LoggingObject.cs
- KerberosSecurityTokenAuthenticator.cs
- AssociatedControlConverter.cs
- RecordManager.cs
- TargetFrameworkAttribute.cs
- webclient.cs
- SecurityAppliedMessage.cs
- CssClassPropertyAttribute.cs
- ContainerUIElement3D.cs
- CatalogPartCollection.cs
- TypeUtil.cs
- OleAutBinder.cs
- FormsAuthenticationModule.cs
- ColumnPropertiesGroup.cs
- BCLDebug.cs
- CqlQuery.cs
- RuntimeConfig.cs
- ControlCommandSet.cs
- UserControl.cs
- ExtensibleClassFactory.cs
- PerfService.cs
- GridViewDeleteEventArgs.cs
- BlurEffect.cs
- StoreAnnotationsMap.cs
- Filter.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- VisualStyleTypesAndProperties.cs
- IdentityHolder.cs
- TypePropertyEditor.cs
- NetworkInformationException.cs
- XdrBuilder.cs
- ObjectDataSourceEventArgs.cs
- KnownBoxes.cs
- Track.cs
- BindStream.cs
- TransactionChannelFaultConverter.cs
- OleAutBinder.cs
- BaseDataBoundControlDesigner.cs
- SponsorHelper.cs
- HttpCookieCollection.cs
- SmiXetterAccessMap.cs
- CodeTypeParameter.cs
- NumberFunctions.cs
- CodeTryCatchFinallyStatement.cs
- TraceSection.cs
- RowBinding.cs
- JsonEncodingStreamWrapper.cs
- TrackingDataItemValue.cs
- CrossSiteScriptingValidation.cs
- QueryRewriter.cs
- ConstraintCollection.cs
- SessionConnectionReader.cs
- Win32SafeHandles.cs
- Function.cs
- ClientUtils.cs
- DataGridViewLinkColumn.cs
- BoolExpression.cs
- ErrorRuntimeConfig.cs
- PropertyValueChangedEvent.cs
- TypeToken.cs
- ParallelRangeManager.cs