TaskScheduler.FromCurrentSynchronizationContext 方法

定义

创建与当前SynchronizationContext关联的项TaskScheduler

public:
 static System::Threading::Tasks::TaskScheduler ^ FromCurrentSynchronizationContext();
public static System.Threading.Tasks.TaskScheduler FromCurrentSynchronizationContext();
static member FromCurrentSynchronizationContext : unit -> System.Threading.Tasks.TaskScheduler
Public Shared Function FromCurrentSynchronizationContext () As TaskScheduler

返回

与当前关联的值TaskScheduler,由该集合决定CurrentSynchronizationContext

例外

当前 SynchronizationContext 不能用作 TaskScheduler。

注解

排队到返回的计划程序的所有 Task 实例将通过调用 Post 该上下文上的方法来执行。

有关详细信息,请参阅 TaskScheduler

适用于

另请参阅