ExecutionContext.Run(ExecutionContext, ContextCallback, Object) Método
Definição
Executa um método em um contexto de execução especificado no thread atual.Runs a method in a specified execution context on the current thread.
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)
Parâmetros
- executionContext
- ExecutionContext
ExecutionContext ao dataset.The ExecutionContext to set.
- callback
- ContextCallback
Um ContextCallback delegado que representa o método a ser executado no contexto de execução fornecido.A ContextCallback delegate that represents the method to be run in the provided execution context.
- state
- Object
O objeto a passar para o método de retorno de chamada.The object to pass to the callback method.
- Atributos
Exceções
executionContext é null.executionContext is null.
- ou --or-
executionContext não foi adquirido por meio de uma operação de captura.executionContext was not acquired through a capture operation.
- ou --or-
executionContext já foi usado como argumento para uma chamada Run(ExecutionContext, ContextCallback, Object) .executionContext has already been used as the argument to a Run(ExecutionContext, ContextCallback, Object) call.
Comentários
O contexto de execução e os contextos de sincronização do thread de chamada são retornados aos seus Estados anteriores quando o método é concluído.The execution context and synchronization contexts of the calling thread are returned to their previous states when the method completes.