TaskScheduler.FromCurrentSynchronizationContext 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會產生 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。