ExecutionContext.Run(ExecutionContext, ContextCallback, Object) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Kör en metod i en angiven körningskontext i den aktuella tråden.
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)
Parametrar
- executionContext
- ExecutionContext
Att ExecutionContext ange.
- callback
- ContextCallback
Ett ContextCallback ombud som representerar den metod som ska köras i den angivna körningskontexten.
- state
- Object
Objektet som ska skickas till återanropsmetoden.
- Attribut
Undantag
executionContext är null.
-eller-
executionContext inte förvärvades genom en avbildningsåtgärd.
-eller-
executionContext har redan använts som argument för ett Run(ExecutionContext, ContextCallback, Object) anrop.
Kommentarer
Körningskontexten och synkroniseringskontexterna för den anropande tråden returneras till deras tidigare tillstånd när metoden är klar.