Manages the execution context for the current thread. This class cannot be inherited.
More...
Manages the execution context for the current thread. This class cannot be inherited.
Definition at line 14 of file ExecutionContext.cs.
◆ Capture()
Captures the execution context from the current thread.
- Returns
- An T:System.Threading.ExecutionContext object representing the execution context for the current thread.
Definition at line 686 of file ExecutionContext.cs.
◆ CreateCopy()
Creates a copy of the current execution context.
- Returns
- An T:System.Threading.ExecutionContext object representing the current execution context.
- Exceptions
-
T:System.InvalidOperationException | This context cannot be copied because it is used. Only newly captured contexts can be copied. |
Definition at line 595 of file ExecutionContext.cs.
◆ Dispose()
void System.Threading.ExecutionContext.Dispose |
( |
| ) |
|
◆ GetObjectData()
Sets the specified T:System.Runtime.Serialization.SerializationInfo object with the logical context information needed to recreate an instance of the current execution context.
- Parameters
-
info | The T:System.Runtime.Serialization.SerializationInfo object to be populated with serialization information. |
context | The T:System.Runtime.Serialization.StreamingContext structure representing the destination context of the serialization. |
- Exceptions
-
T:System.ArgumentNullException | info is null . |
Implements System.Runtime.Serialization.ISerializable.
Definition at line 756 of file ExecutionContext.cs.
◆ IsFlowSuppressed()
static bool System.Threading.ExecutionContext.IsFlowSuppressed |
( |
| ) |
|
|
static |
Indicates whether the flow of the execution context is currently suppressed.
- Returns
true
if the flow is suppressed; otherwise, false
.
Definition at line 676 of file ExecutionContext.cs.
◆ RestoreFlow()
static void System.Threading.ExecutionContext.RestoreFlow |
( |
| ) |
|
|
static |
Restores the flow of the execution context across asynchronous threads.
- Exceptions
-
T:System.InvalidOperationException | The context flow cannot be restored because it is not being suppressed. |
Definition at line 663 of file ExecutionContext.cs.
◆ Run()
Runs a method in a specified execution context on the current thread.
- Parameters
-
executionContext | The T:System.Threading.ExecutionContext to set. |
callback | A T:System.Threading.ContextCallback delegate that represents the method to be run in the provided execution context. |
state | The object to pass to the callback method. |
- Exceptions
-
T:System.InvalidOperationException | executionContext is null .-or- executionContext was not acquired through a capture operation. -or- executionContext has already been used as the argument to a M:System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object) call. |
Definition at line 468 of file ExecutionContext.cs.
◆ SuppressFlow()
Suppresses the flow of the execution context across asynchronous threads.
- Returns
- An T:System.Threading.AsyncFlowControl structure for restoring the flow.
- Exceptions
-
T:System.InvalidOperationException | The context flow is already suppressed. |
Definition at line 649 of file ExecutionContext.cs.
The documentation for this class was generated from the following file: