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

與目前的 SynchronizationContext 關聯的 TaskScheduler,由 Current 決定。

例外狀況

目前的 SynchronizationContext 不可當做 TaskScheduler 使用。

備註

所有 Task 排入佇列至傳回排程器的實例都會透過呼叫 Post 該內容上的 方法來執行。

如需詳細資訊,請參閱TaskScheduler

適用於

另請參閱