ExecutionContext.Run(ExecutionContext, ContextCallback, Object) 方法

定義

在目前執行緒上的指定執行內容中執行方法。

public:
 static void Run(System::Threading::ExecutionContext ^ executionContext, System::Threading::ContextCallback ^ callback, System::Object ^ state);
[System.Security.SecurityCritical]
public static void Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state);
public static void Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object? state);
public static void Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state);
[<System.Security.SecurityCritical>]
static member Run : System.Threading.ExecutionContext * System.Threading.ContextCallback * obj -> unit
static member Run : System.Threading.ExecutionContext * System.Threading.ContextCallback * obj -> unit
Public Shared Sub Run (executionContext As ExecutionContext, callback As ContextCallback, state As Object)

參數

executionContext
ExecutionContext

要設定的 ExecutionContext

callback
ContextCallback

ContextCallback 委派,表示要在所提供執行內容中執行的方法。

state
Object

要傳遞至回呼 (Callback) 方法的物件。

屬性

例外狀況

executionContextnull

-或- executionContext 不是透過擷取作業取得。

-或- 已經將 executionContext 當做 Run(ExecutionContext, ContextCallback, Object) 呼叫的引數使用。

備註

呼叫端執行緒的執行內容和同步處理內容會在方法完成時傳回至先前的狀態。

適用於