Esempio n. 1
0
 private void TraceMilestone(TraceEventType type)
 {
     if (string.IsNullOrEmpty(this.Name))
     {
         if (FxTrace.Trace != null)
         {
             this.CallEtwMileStoneEvent(type, null);
         }
         if (DiagnosticUtility.DiagnosticTrace != null)
         {
             TraceUtility.TraceEventNoCheck(type, 0x2000d, ActivityBoundaryDescription, null, ActivityBoundaryDescription, null);
         }
     }
     else
     {
         if (FxTrace.Trace != null)
         {
             Dictionary <string, string> dictionary = new Dictionary <string, string>(2);
             dictionary["ActivityName"] = this.Name;
             dictionary["ActivityType"] = ActivityTypeNames[(int)this.activityType];
             using ((DiagnosticUtility.ShouldUseActivity && (Guid.Empty == this.activityId)) ? null : Activity.CreateActivity(this.Id))
             {
                 this.CallEtwMileStoneEvent(type, new DictionaryTraceRecord(dictionary));
             }
         }
         if (DiagnosticUtility.DiagnosticTrace != null)
         {
             Dictionary <string, string> dictionary2 = new Dictionary <string, string>(2);
             dictionary2["ActivityName"] = this.Name;
             dictionary2["ActivityType"] = ActivityTypeNames[(int)this.activityType];
             TraceUtility.TraceEventNoCheck(type, 0x2000d, ActivityBoundaryDescription, new DictionaryTraceRecord(dictionary2), null, null, this.Id);
         }
     }
 }
 void TraceMilestone(TraceEventType type)
 {
     if (string.IsNullOrEmpty(this.Name))
     {
         if (null != FxTrace.Trace)
         {
             CallEtwMileStoneEvent(type, null);
         }
         if (null != DiagnosticUtility.DiagnosticTrace)
         {
             TraceUtility.TraceEventNoCheck(type, TraceCode.ActivityBoundary, ServiceModelActivity.ActivityBoundaryDescription, null, ServiceModelActivity.ActivityBoundaryDescription, (Exception)null);
         }
     }
     else
     {
         if (null != FxTrace.Trace)
         {
             Dictionary <string, string> values = new Dictionary <string, string>(2);
             values["ActivityName"] = this.Name;
             values["ActivityType"] = ServiceModelActivity.ActivityTypeNames[(int)this.activityType];
             using (DiagnosticUtility.ShouldUseActivity && Guid.Empty == activityId ? null : Activity.CreateActivity(this.Id))
             {
                 CallEtwMileStoneEvent(type, new DictionaryTraceRecord(values));
             }
         }
         if (null != DiagnosticUtility.DiagnosticTrace)
         {
             Dictionary <string, string> values = new Dictionary <string, string>(2);
             values["ActivityName"] = this.Name;
             values["ActivityType"] = ServiceModelActivity.ActivityTypeNames[(int)this.activityType];
             TraceUtility.TraceEventNoCheck(type, TraceCode.ActivityBoundary, ServiceModelActivity.ActivityBoundaryDescription, new DictionaryTraceRecord(values), null, null, this.Id);
         }
     }
 }