public void Clear() { foreach (IContextPlugin contextPlugin in SingleContext.pluginChain) { contextPlugin.Clear(); } DebugContext.Clear(); }
internal static void Refresh() { int?num = new int?(Environment.CurrentManagedThreadId); int?num2 = (int?)DebugContext.GetDebugProperty(DebugProperties.ThreadId); if (num2 != null) { int?num3 = num; int?num4 = num2; if (num3.GetValueOrDefault() == num4.GetValueOrDefault()) { bool flag = num3 != null != (num4 != null); } } }
public ActivityContextState Suspend() { Func <string, LocalizedString> func = (string debugInfo) => DiagnosticsResources.ExceptionMustStartBeforeSuspend(debugInfo); if (this.status == 2) { try { throw new ActivityContextException(func(DebugContext.GetDebugInfo())); } catch (ActivityContextException) { } return(new ActivityContextState(this, this.metadata)); } this.TransitionToFinalStatus(ActivityContextStatus.ActivitySuspended, ActivityContext.OnSuspendEventArgs); return(new ActivityContextState(this, this.metadata)); }
internal void UpdateFromState(ActivityContextState state) { if (state != null) { if (state.ActivityId != null) { this.ActivityId = state.ActivityId.Value; this.ActivityType = state.ActivityType; } if (state.Properties != null) { foreach (KeyValuePair <Enum, object> keyValuePair in state.Properties) { this.SetPropertyObject(keyValuePair.Key, keyValuePair.Value); } } DebugContext.UpdateFrom(this); } }
private static void SetDebugProperty(DebugProperties debugProperty, object value) { DebugContext.SetProperty(debugProperty, value); }
internal static void UpdateFrom(IActivityScope activityScope) { DebugContext.SetActivityId(activityScope.ActivityId); }
internal static void SetActivityId(Guid value) { DebugContext.SetProperty(DebugProperties.ActivityId, value); }