TaskExtensions.DispatcherOperationWait 方法

定義

等候基礎 DispatcherOperation 完成。Waits for the underlying DispatcherOperation to complete.

多載

DispatcherOperationWait(Task)

無限期等候基礎 DispatcherOperation 完成。Waits indefinitely for the underlying DispatcherOperation to complete.

DispatcherOperationWait(Task, TimeSpan)

在指定的時間長度中等候,等候基礎 DispatcherOperation 完成。Waits for the specified amount of time for the underlying DispatcherOperation to complete.

DispatcherOperationWait(Task)

無限期等候基礎 DispatcherOperation 完成。Waits indefinitely for the underlying DispatcherOperation to complete.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Windows::Threading::DispatcherOperationStatus DispatcherOperationWait(System::Threading::Tasks::Task ^ this);
public static System.Windows.Threading.DispatcherOperationStatus DispatcherOperationWait (this System.Threading.Tasks.Task this);
static member DispatcherOperationWait :  -> System.Windows.Threading.DispatcherOperationStatus
<Extension()>
Public Function DispatcherOperationWait (this As Task) As DispatcherOperationStatus

參數

this
Task

Task 相關聯的 DispatcherOperationThe Task that is associated with the DispatcherOperation.

傳回

基礎 DispatcherOperation 的狀態。The status of the underlying DispatcherOperation.

例外狀況

Task 沒有與 DispatcherOperation 相關聯。The Task is not associated with a DispatcherOperation.

備註

呼叫方法, 以在呼叫這個Task方法DispatcherOperation之前, 檢查是否與相關聯。 IsDispatcherOperationTaskCall the IsDispatcherOperationTask method to check whether the Task is associated with a DispatcherOperation before you call this method.

DispatcherOperationWait(Task, TimeSpan)

在指定的時間長度中等候,等候基礎 DispatcherOperation 完成。Waits for the specified amount of time for the underlying DispatcherOperation to complete.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Windows::Threading::DispatcherOperationStatus DispatcherOperationWait(System::Threading::Tasks::Task ^ this, TimeSpan timeout);
public static System.Windows.Threading.DispatcherOperationStatus DispatcherOperationWait (this System.Threading.Tasks.Task this, TimeSpan timeout);
static member DispatcherOperationWait : TimeSpan -> System.Windows.Threading.DispatcherOperationStatus
<Extension()>
Public Function DispatcherOperationWait (this As Task, timeout As TimeSpan) As DispatcherOperationStatus

參數

this
Task

Task 相關聯的 DispatcherOperationThe Task that is associated with the DispatcherOperation.

timeout
TimeSpan

要等候的時間量。The amount of time to wait.

傳回

基礎 DispatcherOperation 的狀態。The status of the underlying DispatcherOperation.

例外狀況

Task 沒有與 DispatcherOperation 相關聯。The Task is not associated with a DispatcherOperation.

備註

呼叫方法, 以在呼叫這個Task方法DispatcherOperation之前, 檢查是否與相關聯。 IsDispatcherOperationTaskCall the IsDispatcherOperationTask method to check whether the Task is associated with a DispatcherOperation before you call this method.

適用於