ExecutionContext.Run(ExecutionContext, ContextCallback, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在當前執行緒中執行指定的執行上下文中執行一個方法。
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
要傳遞給回調方法的物件。
- 屬性
例外狀況
executionContext 是 null。
-或-
executionContext 並非透過捕獲行動取得。
-或-
executionContext 已被用作判決的論點 Run(ExecutionContext, ContextCallback, Object) 。
備註
呼叫執行緒的執行上下文與同步上下文在方法完成時會回復到先前狀態。