Creates a
TaskScheduler
associated with the current
SynchronizationContext.
Namespace:
System.Threading.Tasks
Assembly:
System.Threading (in System.Threading.dll)
Syntax
| Visual Basic (Declaration) |
|---|
Public Shared Function FromCurrentSynchronizationContext As TaskScheduler |
| C# |
|---|
public static TaskScheduler FromCurrentSynchronizationContext() |
Return Value
A
TaskScheduler associated with
the current
SynchronizationContext, as
determined by
SynchronizationContext.Current.
Remarks
Exceptions
| Exception | Condition |
|---|
| System..::.InvalidOperationException |
The current SynchronizationContext may not be used as a TaskScheduler.
|
See Also