ExecutionContext.Run(ExecutionContext, ContextCallback, Object) Méthode

Définition

Exécute une méthode dans un contexte d'exécution spécifié sur le thread actuel.

C#
[System.Security.SecurityCritical]
public static void Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state);
C#
public static void Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object? state);
C#
public static void Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state);

Paramètres

executionContext
ExecutionContext

ExecutionContext à définir.

callback
ContextCallback

Délégué ContextCallback représentant la méthode à exécuter dans le contexte d'exécution fourni.

state
Object

Objet à passer à la méthode de rappel.

Attributs

Exceptions

executionContext est null.

Remarques

Le contexte d’exécution et les contextes de synchronisation du thread appelant sont retournés à leurs états précédents lorsque la méthode se termine.

S’applique à

Produit Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0