TaskScheduler.FromCurrentSynchronizationContext Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Creates a TaskScheduler associated with the current System.Threading.SynchronizationContext.
Assembly: mscorlib (in mscorlib.dll)
Return Value
Type: System.Threading.Tasks.TaskSchedulerA TaskScheduler associated with the current System.Threading.SynchronizationContext, as determined by SynchronizationContext.Current.
| Exception | Condition |
|---|---|
| InvalidOperationException | The current SynchronizationContext may not be used as a TaskScheduler. |
All Task instances queued to the returned scheduler will be executed through a call to the Post method on that context.
For more information, see [638f8ea5-21db-47a2-a934-86e1e961bf65].
Show: