Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / SMDiagnostics / System / ServiceModel / Diagnostics / Activity.cs / 1 / Activity.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.ServiceModel.Diagnostics
{
class Activity : IDisposable
{
protected Guid parentId;
Guid currentId;
bool mustDispose = false;
protected Activity(Guid activityId, Guid parentId)
{
this.currentId = activityId;
this.parentId = parentId;
this.mustDispose = true;
DiagnosticTrace.ActivityId = this.currentId;
}
internal static Activity CreateActivity(Guid activityId)
{
Activity retval = null;
if (activityId != Guid.Empty)
{
Guid currentActivityId = DiagnosticTrace.ActivityId;
if (activityId != currentActivityId)
{
retval = new Activity(activityId, currentActivityId);
}
}
return retval;
}
public virtual void Dispose()
{
if (this.mustDispose)
{
this.mustDispose = false;
DiagnosticTrace.ActivityId = this.parentId;
}
GC.SuppressFinalize(this);
}
protected Guid Id
{
get { return this.currentId; }
}
}
}
// 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
- KeyTime.cs
- ListBoxItemWrapperAutomationPeer.cs
- UsernameTokenFactoryCredential.cs
- PaperSize.cs
- UrlPropertyAttribute.cs
- RefreshPropertiesAttribute.cs
- BitmapCodecInfo.cs
- HebrewCalendar.cs
- Component.cs
- GroupBoxRenderer.cs
- LabelLiteral.cs
- BindingBase.cs
- ExpressionBuilderContext.cs
- TypeUnloadedException.cs
- WmlSelectionListAdapter.cs
- UpdatePanelTriggerCollection.cs
- DisplayNameAttribute.cs
- SelectionRangeConverter.cs
- ToolStripPanelRow.cs
- TransformationRules.cs
- CodeIterationStatement.cs
- FillErrorEventArgs.cs
- EUCJPEncoding.cs
- DependencyObjectValidator.cs
- BookmarkEventArgs.cs
- ModifierKeysConverter.cs
- HashCodeCombiner.cs
- DependencyPropertyChangedEventArgs.cs
- DPCustomTypeDescriptor.cs
- TagPrefixAttribute.cs
- TemplateControl.cs
- AnnotationMap.cs
- ObjectStateEntryDbDataRecord.cs
- AvTraceDetails.cs
- FrugalList.cs
- Italic.cs
- HMAC.cs
- Source.cs
- TraceSection.cs
- PlacementWorkspace.cs
- Configuration.cs
- ContentValidator.cs
- DrawingState.cs
- RootBrowserWindow.cs
- FormViewPageEventArgs.cs
- EndEvent.cs
- SharedStream.cs
- Ref.cs
- FilterUserControlBase.cs
- InputScope.cs
- XmlAnyElementAttributes.cs
- TableLayoutPanelCellPosition.cs
- EventsTab.cs
- XmlSchemaException.cs
- Domain.cs
- DataObjectAttribute.cs
- MatchAttribute.cs
- SqlNotificationRequest.cs
- TreeNodeBinding.cs
- X509Certificate2Collection.cs
- Int16Converter.cs
- ChangePassword.cs
- SelectionPattern.cs
- MustUnderstandSoapException.cs
- DiagnosticsConfigurationHandler.cs
- SchemaImporterExtensionsSection.cs
- TextDecoration.cs
- TypefaceMetricsCache.cs
- HttpModulesSection.cs
- FileAuthorizationModule.cs
- StringUtil.cs
- ObjectListCommandsPage.cs
- Type.cs
- ReflectionUtil.cs
- WindowsRichEdit.cs
- TimeoutHelper.cs
- CommonGetThemePartSize.cs
- ConfigurationSectionGroup.cs
- OutputScope.cs
- SynchronizationLockException.cs
- HttpCapabilitiesSectionHandler.cs
- DefaultPerformanceCounters.cs
- WindowsStatic.cs
- AsyncMethodInvoker.cs
- TypeSource.cs
- NetPipeSectionData.cs
- BufferedReceiveElement.cs
- ConsumerConnectionPoint.cs
- JsonSerializer.cs
- ListItem.cs
- XmlNamespaceMappingCollection.cs
- xmlglyphRunInfo.cs
- MaterialGroup.cs
- SafeTokenHandle.cs
- FormViewUpdateEventArgs.cs
- ProcessThread.cs
- StateDesignerConnector.cs
- WebResourceAttribute.cs
- CodeDOMProvider.cs
- RoutedEventArgs.cs