System\ServiceModel\ChannelFactory.cs (15)
548using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
552ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityConstructChannelFactory, typeof(TChannel).FullName), ActivityType.Construct);
568using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
572ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityConstructChannelFactory, typeof(TChannel).FullName), ActivityType.Construct);
598using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
602ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityConstructChannelFactory, typeof(TChannel).FullName), ActivityType.Construct);
617using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
621ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityConstructChannelFactory, typeof(TChannel).FullName), ActivityType.Construct);
692using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity && this.TraceOpenAndClose ? ServiceModelActivity.CreateBoundedActivity() : null)
696ServiceModelActivity.Start(activity, this.OpenActivityName, this.OpenActivityType);
System\ServiceModel\Channels\TracingConnection.cs (21)
15ServiceModelActivity activity;
19public TracingConnection(IConnection connection, ServiceModelActivity activity)
29ServiceModelActivity.CreateActivity(DiagnosticTraceBase.ActivityId, false) :
30ServiceModelActivity.CreateActivity();
45using (ServiceModelActivity.BoundOperation(this.activity))
75using (ServiceModelActivity.BoundOperation(this.activity, true))
91using (ServiceModelActivity.BoundOperation(this.activity, true))
99using (ServiceModelActivity.BoundOperation(this.activity))
101ServiceModelActivity.Start(this.activity, SR.GetString(SR.ActivityReceiveBytes, name), ActivityType.ReceiveBytes);
107using (ServiceModelActivity.BoundOperation(this.activity))
109ServiceModelActivity.Start(this.activity, SR.GetString(SR.ActivityReceiveBytes, uri.ToString()), ActivityType.ReceiveBytes);
115using (ServiceModelActivity.BoundOperation(this.activity))
123using (ServiceModelActivity.BoundOperation(this.activity))
131using (ServiceModelActivity.BoundOperation(this.activity))
139using (ServiceModelActivity.BoundOperation(this.activity))
147using (ServiceModelActivity.BoundOperation(this.activity))
161using (ServiceModelActivity.BoundOperation(this.activity))
188using (ServiceModelActivity.BoundOperation(this.activity, true))
198ServiceModelActivity activity;
200internal TracingConnectionState(WaitCallback callback, ServiceModelActivity activity, object state)
209using (ServiceModelActivity.BoundOperation(this.activity))
System\ServiceModel\Diagnostics\ServiceModelActivity.cs (66)
20static ServiceModelActivity currentActivity;
24ServiceModelActivity previousActivity = null;
59this.previousActivity = ServiceModelActivity.Current;
66if (ServiceModelActivity.activityBoundaryDescription == null)
68ServiceModelActivity.activityBoundaryDescription = TraceSR.GetString(TraceSR.ActivityBoundary);
70return ServiceModelActivity.activityBoundaryDescription;
79internal ServiceModelActivity PreviousActivity
84static internal Activity BoundOperation(ServiceModelActivity activity)
90return ServiceModelActivity.BoundOperation(activity, false);
93static internal Activity BoundOperation(ServiceModelActivity activity, bool addTransfer)
95return activity == null ? null : ServiceModelActivity.BoundOperationCore(activity, addTransfer);
98static Activity BoundOperationCore(ServiceModelActivity activity, bool addTransfer)
110retval.SetPreviousServiceModelActivity(ServiceModelActivity.Current);
112ServiceModelActivity.Current = activity;
117internal static ServiceModelActivity CreateActivity()
123return ServiceModelActivity.CreateActivity(Guid.NewGuid(), true);
126internal static ServiceModelActivity CreateActivity(bool autoStop)
132ServiceModelActivity activity = ServiceModelActivity.CreateActivity(Guid.NewGuid(), true);
140internal static ServiceModelActivity CreateActivity(bool autoStop, string activityName, ActivityType activityType)
146ServiceModelActivity activity = ServiceModelActivity.CreateActivity(autoStop);
147ServiceModelActivity.Start(activity, activityName, activityType);
151internal static ServiceModelActivity CreateAsyncActivity()
157ServiceModelActivity activity = ServiceModelActivity.CreateActivity(true);
165internal static ServiceModelActivity CreateBoundedActivity()
167return ServiceModelActivity.CreateBoundedActivity(false);
170internal static ServiceModelActivity CreateBoundedActivity(bool suspendCurrent)
176ServiceModelActivity activityToSuspend = ServiceModelActivity.Current;
177ServiceModelActivity retval = ServiceModelActivity.CreateActivity(true);
180retval.activity = (TransferActivity)ServiceModelActivity.BoundOperation(retval, true);
194internal static ServiceModelActivity CreateBoundedActivity(Guid activityId)
200ServiceModelActivity retval = ServiceModelActivity.CreateActivity(activityId, true);
203retval.activity = (TransferActivity)ServiceModelActivity.BoundOperation(retval, true);
208internal static ServiceModelActivity CreateBoundedActivityWithTransferInOnly(Guid activityId)
214ServiceModelActivity retval = ServiceModelActivity.CreateActivity(activityId, true);
221retval.activity = (TransferActivity)ServiceModelActivity.BoundOperation(retval);
226internal static ServiceModelActivity CreateLightWeightAsyncActivity(Guid activityId)
231internal static ServiceModelActivity CreateActivity(Guid activityId)
237ServiceModelActivity retval = null;
244ServiceModelActivity.Current = retval;
249internal static ServiceModelActivity CreateActivity(Guid activityId, bool autoStop)
255ServiceModelActivity retval = ServiceModelActivity.CreateActivity(activityId);
263internal static ServiceModelActivity Current
265get { return ServiceModelActivity.currentActivity; }
266private set { ServiceModelActivity.currentActivity = value; }
285ServiceModelActivity.Current != null)
287ServiceModelActivity.Current.Resume();
292ServiceModelActivity.Current = this.previousActivity;
333static internal void Start(ServiceModelActivity activity, string activityName, ActivityType activityType)
352(!this.isAsync || (this.isAsync && newStopCount >= ServiceModelActivity.AsyncStopCount)))
359static internal void Stop(ServiceModelActivity activity)
391TraceUtility.TraceEventNoCheck(type, TraceCode.ActivityBoundary, ServiceModelActivity.ActivityBoundaryDescription, null, ServiceModelActivity.ActivityBoundaryDescription, (Exception)null);
400values["ActivityType"] = ServiceModelActivity.ActivityTypeNames[(int)this.activityType];
410values["ActivityType"] = ServiceModelActivity.ActivityTypeNames[(int)this.activityType];
411TraceUtility.TraceEventNoCheck(type, TraceCode.ActivityBoundary, ServiceModelActivity.ActivityBoundaryDescription, new DictionaryTraceRecord(values), null, null, this.Id);
461ServiceModelActivity previousActivity = null;
495internal void SetPreviousServiceModelActivity(ServiceModelActivity previous)
523ServiceModelActivity.Current = this.previousActivity;
System\ServiceModel\DuplexChannelFactory.cs (12)
72using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
76ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityConstructChannelFactory, TraceUtility.CreateSourceString(this)), ActivityType.Construct);
98using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
102ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityConstructChannelFactory, TraceUtility.CreateSourceString(this)), ActivityType.Construct);
134using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
138ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityConstructChannelFactory, TraceUtility.CreateSourceString(this)), ActivityType.Construct);
159using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
163ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityConstructChannelFactory, TraceUtility.CreateSourceString(this)), ActivityType.Construct);
System\ServiceModel\Security\SecuritySessionClientSettings.cs (23)
636using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ?
637ServiceModelActivity.CreateBoundedActivity() : null)
641ServiceModelActivity.Start(activity, SR.GetString(SR.ActivitySecuritySetup), ActivityType.SecuritySetup);
652ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ?
653ServiceModelActivity.CreateAsyncActivity() : null;
654using (ServiceModelActivity.BoundOperation(activity, true))
658ServiceModelActivity.Start(activity, SR.GetString(SR.ActivitySecuritySetup), ActivityType.SecuritySetup);
852using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ?
853ServiceModelActivity.CreateBoundedActivity() : null)
857ServiceModelActivity.Start(activity, SR.GetString(SR.ActivitySecurityClose), ActivityType.SecuritySetup);
1249using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ?
1250ServiceModelActivity.CreateBoundedActivity() : null)
1254ServiceModelActivity.Start(activity, SR.GetString(SR.ActivitySecurityRenew), ActivityType.SecuritySetup);
1431using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ?
1432ServiceModelActivity.CreateBoundedActivity() : null)
1436ServiceModelActivity.Start(activity, SR.GetString(SR.ActivitySecurityClose), ActivityType.SecuritySetup);
1460using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ?
1461ServiceModelActivity.CreateAsyncActivity() : null)
1465ServiceModelActivity.Start(activity, SR.GetString(SR.ActivitySecurityClose), ActivityType.SecuritySetup);
2025using (ServiceModelActivity.BoundOperation(thisAsyncResult.CallbackActivity))
2063ServiceModelActivity.Stop(((OpenAsyncResult)result).CallbackActivity);
2227ServiceModelActivity.Stop(thisResult.CallbackActivity);
2498using (thisResult.CallbackActivity == null ? null : ServiceModelActivity.BoundOperation(thisResult.CallbackActivity))