共用方式為


DiagnosticSource.StartActivity 方法

定義

多載

StartActivity(Activity, Object)

啟動 Activity 並寫入啟動事件。

StartActivity<T>(Activity, T)

StartActivity(Activity, Object)

來源:
DiagnosticSourceActivity.cs
來源:
DiagnosticSourceActivity.cs
來源:
DiagnosticSourceActivity.cs

啟動 Activity 並寫入啟動事件。

public:
 System::Diagnostics::Activity ^ StartActivity(System::Diagnostics::Activity ^ activity, System::Object ^ args);
public System.Diagnostics.Activity StartActivity (System.Diagnostics.Activity activity, object? args);
public System.Diagnostics.Activity StartActivity (System.Diagnostics.Activity activity, object args);
member this.StartActivity : System.Diagnostics.Activity * obj -> System.Diagnostics.Activity
Public Function StartActivity (activity As Activity, args As Object) As Activity

參數

activity
Activity

要啟動的 Activity

args
Object

物件,代表要傳遞為事件承載的值。

傳回

方便鏈結的已啟動活動。

備註

描述 Activity 邏輯作業、其內容和父關聯性;目前 Activity 會流經作業處理。

這個方法會啟動指定的 Activity、維護指定 Activity之 的全域Activity.Current和活動Activity.Parent,並通知取用者已啟動新的 Activity 。 取用者可以存取 Activity.Current 以新增內容和/或增強遙測。

產生者可能會將其他詳細數據傳遞給承載中的取用者。

適用於

StartActivity<T>(Activity, T)

來源:
DiagnosticSourceActivity.cs
來源:
DiagnosticSourceActivity.cs
public:
generic <typename T>
 System::Diagnostics::Activity ^ StartActivity(System::Diagnostics::Activity ^ activity, T args);
public System.Diagnostics.Activity StartActivity<T> (System.Diagnostics.Activity activity, T args);
member this.StartActivity : System.Diagnostics.Activity * 'T -> System.Diagnostics.Activity
Public Function StartActivity(Of T) (activity As Activity, args As T) As Activity

類型參數

T

參數

activity
Activity
args
T

傳回

適用於