WindowsRuntimeSystemExtensions.GetAwaiter 方法

定义

重载

GetAwaiter(IAsyncAction)

此 API 支持 .NET Framework 基础结构,但不应在代码中直接使用。This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

GetAwaiter<TProgress>(IAsyncActionWithProgress<TProgress>)

返回等待报告进度的异步操作对象。Returns an object that awaits an asynchronous action that reports progress.

GetAwaiter<TResult,TProgress>(IAsyncOperationWithProgress<TResult,TProgress>)

返回等待报告进度并返回结果的异步操作的对象。Returns an object that awaits an asynchronous operation that reports progress and returns a result.

GetAwaiter<TResult>(IAsyncOperation<TResult>)

返回等待返回结果的异步操作对象。Returns an object that awaits an asynchronous operation that returns a result.

GetAwaiter(IAsyncAction)

此 API 支持 .NET Framework 基础结构,但不应在代码中直接使用。This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Runtime::CompilerServices::TaskAwaiter GetAwaiter(Windows::Foundation::IAsyncAction ^ source);
public static System.Runtime.CompilerServices.TaskAwaiter GetAwaiter (this Windows.Foundation.IAsyncAction source);
static member GetAwaiter : Windows.Foundation.IAsyncAction -> System.Runtime.CompilerServices.TaskAwaiter
<Extension()>
Public Function GetAwaiter (source As IAsyncAction) As TaskAwaiter

参数

source
IAsyncAction

要等待的异步操作。The asynchronous action to await.

返回

TaskAwaiter

等待指定的异步操作的对象。An object that awaits the specified asynchronous action.

注解

备注

在 Visual Basic 和 c # 中,你可以将此方法作为 IAsyncAction 类型的任何对象上的实例方法来调用。In Visual Basic and C#, you can call this method as an instance method on any object of type IAsyncAction. 当使用实例方法语法调用此方法时,请省略第一个参数。When you use instance method syntax to call this method, omit the first parameter. 有关详细信息,请参阅c # 编程指南) Visual Basic) 或 (扩展方法 (的扩展方法For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

适用于

GetAwaiter<TProgress>(IAsyncActionWithProgress<TProgress>)

返回等待报告进度的异步操作对象。Returns an object that awaits an asynchronous action that reports progress.

public:
generic <typename TProgress>
[System::Runtime::CompilerServices::Extension]
 static System::Runtime::CompilerServices::TaskAwaiter GetAwaiter(Windows::Foundation::IAsyncActionWithProgress<TProgress> ^ source);
public static System.Runtime.CompilerServices.TaskAwaiter GetAwaiter<TProgress> (this Windows.Foundation.IAsyncActionWithProgress<TProgress> source);
static member GetAwaiter : Windows.Foundation.IAsyncActionWithProgress<'Progress> -> System.Runtime.CompilerServices.TaskAwaiter
<Extension()>
Public Function GetAwaiter(Of TProgress) (source As IAsyncActionWithProgress(Of TProgress)) As TaskAwaiter

类型参数

TProgress

提供显示进度的数据的对象的类型。The type of object that provides data that indicates progress.

参数

source
IAsyncActionWithProgress<TProgress>

要等待的异步操作。The asynchronous action to await.

返回

TaskAwaiter

等待指定的异步操作的对象。An object that awaits the specified asynchronous action.

注解

备注

在 Visual Basic 和 c # 中,可以在类型为的任何对象上将此方法作为实例方法来调用 IAsyncActionWithProgress<TProgress>In Visual Basic and C#, you can call this method as an instance method on any object of type IAsyncActionWithProgress<TProgress>. 当使用实例方法语法调用此方法时,请省略第一个参数。When you use instance method syntax to call this method, omit the first parameter. 有关详细信息,请参阅c # 编程指南) Visual Basic) 或 (扩展方法 (的扩展方法For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

适用于

GetAwaiter<TResult,TProgress>(IAsyncOperationWithProgress<TResult,TProgress>)

返回等待报告进度并返回结果的异步操作的对象。Returns an object that awaits an asynchronous operation that reports progress and returns a result.

public:
generic <typename TResult, typename TProgress>
[System::Runtime::CompilerServices::Extension]
 static System::Runtime::CompilerServices::TaskAwaiter<TResult> GetAwaiter(Windows::Foundation::IAsyncOperationWithProgress<TResult, TProgress> ^ source);
public static System.Runtime.CompilerServices.TaskAwaiter<TResult> GetAwaiter<TResult,TProgress> (this Windows.Foundation.IAsyncOperationWithProgress<TResult,TProgress> source);
static member GetAwaiter : Windows.Foundation.IAsyncOperationWithProgress<'Result, 'Progress> -> System.Runtime.CompilerServices.TaskAwaiter<'Result>
<Extension()>
Public Function GetAwaiter(Of TResult, TProgress) (source As IAsyncOperationWithProgress(Of TResult, TProgress)) As TaskAwaiter(Of TResult)

类型参数

TResult

返回异步操作结果的对象的类型。The type of object that returns the result of the asynchronous operation.

TProgress

提供显示进度的数据的对象的类型。The type of object that provides data that indicates progress.

参数

source
IAsyncOperationWithProgress<TResult,TProgress>

等待的异步操作。The asynchronous operation to await.

返回

TaskAwaiter<TResult>

等待指定的异步操作的对象。An object that awaits the specified asynchronous operation.

注解

备注

在 Visual Basic 和 c # 中,可以在类型为的任何对象上将此方法作为实例方法来调用 IAsyncOperationWithProgress<TResult,TProgress>In Visual Basic and C#, you can call this method as an instance method on any object of type IAsyncOperationWithProgress<TResult,TProgress>. 当使用实例方法语法调用此方法时,请省略第一个参数。When you use instance method syntax to call this method, omit the first parameter. 有关详细信息,请参阅c # 编程指南) Visual Basic) 或 (扩展方法 (的扩展方法For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

适用于

GetAwaiter<TResult>(IAsyncOperation<TResult>)

返回等待返回结果的异步操作对象。Returns an object that awaits an asynchronous operation that returns a result.

public:
generic <typename TResult>
[System::Runtime::CompilerServices::Extension]
 static System::Runtime::CompilerServices::TaskAwaiter<TResult> GetAwaiter(Windows::Foundation::IAsyncOperation<TResult> ^ source);
public static System.Runtime.CompilerServices.TaskAwaiter<TResult> GetAwaiter<TResult> (this Windows.Foundation.IAsyncOperation<TResult> source);
static member GetAwaiter : Windows.Foundation.IAsyncOperation<'Result> -> System.Runtime.CompilerServices.TaskAwaiter<'Result>
<Extension()>
Public Function GetAwaiter(Of TResult) (source As IAsyncOperation(Of TResult)) As TaskAwaiter(Of TResult)

类型参数

TResult

返回异步操作结果的对象的类型。The type of object that returns the result of the asynchronous operation.

参数

source
IAsyncOperation<TResult>

等待的异步操作。The asynchronous operation to await.

返回

TaskAwaiter<TResult>

等待指定的异步操作的对象。An object that awaits the specified asynchronous operation.

注解

备注

在 Visual Basic 和 c # 中,你可以将此方法作为 Iasyncoperation 类型的任何对象上的实例方法来调用 。In Visual Basic and C#, you can call this method as an instance method on any object of type IAsyncOperation. 当使用实例方法语法调用此方法时,请省略第一个参数。When you use instance method syntax to call this method, omit the first parameter. 有关详细信息,请参阅c # 编程指南) Visual Basic) 或 (扩展方法 (的扩展方法For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

适用于