TaskScheduler.FromCurrentSynchronizationContext 方法

定義

會產生 TaskScheduler 與電流 SynchronizationContext相關的 。

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

傳回

A TaskScheduler 與電流 SynchronizationContext相關聯,由 決定 Current

例外狀況

目前的 SynchronizationContext 不得用作任務排程器。

備註

所有 Task 排隊到回傳排程器的實例都會透過該上下文中的方法 Post 呼叫來執行。

如需詳細資訊,請參閱TaskScheduler

適用於

另請參閱