ExecutionContext::Run Method (ExecutionContext^, ContextCallback^, Object^)
Runs a method in a specified execution context on the current thread.
Assembly: mscorlib (in mscorlib.dll)
public: [SecurityCriticalAttribute] static void Run( ExecutionContext^ executionContext, ContextCallback^ callback, Object^ state )
Parameters
- executionContext
-
Type:
System.Threading::ExecutionContext^
The ExecutionContext to set.
- callback
-
Type:
System.Threading::ContextCallback^
A ContextCallback delegate that represents the method to be run in the provided execution context.
- state
-
Type:
System::Object^
The object to pass to the callback method.
| Exception | Condition |
|---|---|
| InvalidOperationException | executionContext is null. -or- executionContext was not acquired through a capture operation. -or- executionContext has already been used as the argument to a Run call. |
The execution context is returned to its previous state when the method completes.
Requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Available since 10
.NET Framework
Available since 2.0