TaskExtensions.DispatcherOperationWait 方法

定义

无限期等待基础 DispatcherOperation 完成。

重载

DispatcherOperationWait(Task)

无限期等待完成基础 DispatcherOperation

DispatcherOperationWait(Task, TimeSpan)

等待基础 DispatcherOperation 完成,直到达到指定的所需时间。

DispatcherOperationWait(Task)

无限期等待完成基础 DispatcherOperation

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 关联的 DispatcherOperation

返回

基础 DispatcherOperation 的状态。

例外

注解

调用 方法以 IsDispatcherOperationTask 在调用此方法之前检查 是否 TaskDispatcherOperation 关联。

适用于

DispatcherOperationWait(Task, TimeSpan)

等待基础 DispatcherOperation 完成,直到达到指定的所需时间。

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 关联的 DispatcherOperation

timeout
TimeSpan

要等待的时间长度。

返回

基础 DispatcherOperation 的状态。

例外

注解

调用 方法以 IsDispatcherOperationTask 在调用此方法之前检查 是否 TaskDispatcherOperation 关联。

适用于