ExecutionContext.Run(ExecutionContext, ContextCallback, Object) Metodo

Definizione

Esegue un metodo in un contesto di esecuzione specificato nel thread corrente.

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)

Parametri

executionContext
ExecutionContext

Oggetto ExecutionContext da impostare.

callback
ContextCallback

Delegato ContextCallback che rappresenta il metodo da eseguire nel contesto di esecuzione fornito.

state
Object

Oggetto da passare al metodo di callback.

Attributi

Eccezioni

executionContext è null.

oppure

executionContext non è stato acquisito tramite un'operazione di acquisizione.

oppure

executionContext è già stato usato come argomento per una Run(ExecutionContext, ContextCallback, Object) chiamata.

Commenti

Il contesto di esecuzione e i contesti di sincronizzazione del thread chiamante vengono restituiti agli stati precedenti al termine del metodo.

Si applica a