ExecutionContext.Run(ExecutionContext, ContextCallback, Object) Metoda

Definice

Spustí metodu v zadaném kontextu spuštění v aktuálním vlákně.

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)

Parametry

executionContext
ExecutionContext

Nastavení ExecutionContext

callback
ContextCallback

Delegát ContextCallback , který představuje metodu, která se má spustit v zadaném kontextu spuštění.

state
Object

Objekt, který se má předat metodě zpětného volání.

Atributy

Výjimky

executionContext je null.

nebo

executionContext nebyla získána prostřednictvím operace zachycení.

nebo

executionContext již byl použit jako argument pro Run(ExecutionContext, ContextCallback, Object) volání.

Poznámky

Kontext spuštění a kontexty synchronizace volajícího vlákna se po dokončení metody vrátí do jejich předchozích stavů.

Platí pro