WindowsRuntimeSystemExtensions.GetAwaiter Method

Definition

Overloads

GetAwaiter(IAsyncAction)

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)

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

C#
public static System.Runtime.CompilerServices.TaskAwaiter GetAwaiter(this Windows.Foundation.IAsyncAction source);

Parameters

source
IAsyncAction

The asynchronous action to await.

Returns

An object that awaits the specified asynchronous action.

Remarks

Note

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. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Applies to

UWP 10.0
Product Versions
UWP 10.0

GetAwaiter<TProgress>(IAsyncActionWithProgress<TProgress>)

Returns an object that awaits an asynchronous action that reports progress.

C#
public static System.Runtime.CompilerServices.TaskAwaiter GetAwaiter<TProgress>(this Windows.Foundation.IAsyncActionWithProgress<TProgress> source);

Type Parameters

TProgress

The type of object that provides data that indicates progress.

Parameters

source
IAsyncActionWithProgress<TProgress>

The asynchronous action to await.

Returns

An object that awaits the specified asynchronous action.

Remarks

Note

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. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Applies to

UWP 10.0
Product Versions
UWP 10.0

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

Returns an object that awaits an asynchronous operation that reports progress and returns a result.

C#
public static System.Runtime.CompilerServices.TaskAwaiter<TResult> GetAwaiter<TResult,TProgress>(this Windows.Foundation.IAsyncOperationWithProgress<TResult,TProgress> source);

Type Parameters

TResult

The type of object that returns the result of the asynchronous operation.

TProgress

The type of object that provides data that indicates progress.

Parameters

source
IAsyncOperationWithProgress<TResult,TProgress>

The asynchronous operation to await.

Returns

An object that awaits the specified asynchronous operation.

Remarks

Note

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. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Applies to

UWP 10.0
Product Versions
UWP 10.0

GetAwaiter<TResult>(IAsyncOperation<TResult>)

Returns an object that awaits an asynchronous operation that returns a result.

C#
public static System.Runtime.CompilerServices.TaskAwaiter<TResult> GetAwaiter<TResult>(this Windows.Foundation.IAsyncOperation<TResult> source);

Type Parameters

TResult

The type of object that returns the result of the asynchronous operation.

Parameters

source
IAsyncOperation<TResult>

The asynchronous operation to await.

Returns

An object that awaits the specified asynchronous operation.

Remarks

Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IAsyncOperation<TResult>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Applies to

UWP 10.0
Product Versions
UWP 10.0