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);
[<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

要傳遞給回調方法的物件。

屬性

例外狀況

executionContextnull

-或-

executionContext 並非透過捕獲行動取得。

-或-

executionContext 已被用作判決的論點 Run(ExecutionContext, ContextCallback, Object)

備註

呼叫執行緒的執行上下文與同步上下文在方法完成時會回復到先前狀態。

適用於