コード例 #1
0
 public void Clear()
 {
     foreach (IContextPlugin contextPlugin in SingleContext.pluginChain)
     {
         contextPlugin.Clear();
     }
     DebugContext.Clear();
 }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
 private static void SetDebugProperty(DebugProperties debugProperty, object value)
 {
     DebugContext.SetProperty(debugProperty, value);
 }
コード例 #6
0
 internal static void UpdateFrom(IActivityScope activityScope)
 {
     DebugContext.SetActivityId(activityScope.ActivityId);
 }
コード例 #7
0
 internal static void SetActivityId(Guid value)
 {
     DebugContext.SetProperty(DebugProperties.ActivityId, value);
 }