Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WindowsRuntimeSystemExtensions Class

.NET Framework 4.6 and 4.5

Provides extension methods for converting between tasks and Windows Runtime asynchronous actions and operations.

This API is not CLS-compliant. 

System.Object
  System.WindowsRuntimeSystemExtensions

Namespace:  System
Assembly:  System.Runtime.WindowsRuntime (in System.Runtime.WindowsRuntime.dll)

[CLSCompliantAttribute(false)]
public static class WindowsRuntimeSystemExtensions

The WindowsRuntimeSystemExtensions type exposes the following members.

  NameDescription
Public methodStatic memberAsAsyncActionReturns a Windows Runtime asynchronous action that represents a started task.
Public methodStatic memberAsAsyncOperation<TResult>Returns a Windows Runtime asynchronous operation that represents a started task that returns a result.
Public methodStatic memberAsTask(IAsyncAction)Returns a task that represents a Windows Runtime asynchronous action.
Public methodStatic memberAsTask(IAsyncAction, CancellationToken)Returns a task that represents a Windows Runtime asynchronous action that can be cancelled.
Public methodStatic memberAsTask<TProgress>(IAsyncActionWithProgress<TProgress>)Returns a task that represents a Windows Runtime asynchronous action.
Public methodStatic memberAsTask<TResult>(IAsyncOperation<TResult>)Returns a task that represents a Windows Runtime asynchronous operation returns a result.
Public methodStatic memberAsTask<TProgress>(IAsyncActionWithProgress<TProgress>, IProgress<TProgress>)Returns a task that represents a Windows Runtime asynchronous action that reports progress.
Public methodStatic memberAsTask<TProgress>(IAsyncActionWithProgress<TProgress>, CancellationToken)Returns a task that represents a Windows Runtime asynchronous action that can be cancelled.
Public methodStatic memberAsTask<TResult>(IAsyncOperation<TResult>, CancellationToken)Returns a task that represents a Windows Runtime asynchronous operation that returns a result and can be cancelled.
Public methodStatic memberAsTask<TProgress>(IAsyncActionWithProgress<TProgress>, CancellationToken, IProgress<TProgress>)Returns a task that represents a Windows Runtime asynchronous action that reports progress and can be cancelled.
Public methodStatic memberAsTask<TResult, TProgress>(IAsyncOperationWithProgress<TResult, TProgress>)Returns a task that represents a Windows Runtime asynchronous operation returns a result.
Public methodStatic memberAsTask<TResult, TProgress>(IAsyncOperationWithProgress<TResult, TProgress>, IProgress<TProgress>)Returns a task that represents Windows Runtime asynchronous operation that returns a result and reports progress.
Public methodStatic memberAsTask<TResult, TProgress>(IAsyncOperationWithProgress<TResult, TProgress>, CancellationToken)Returns a task that represents a Windows Runtime asynchronous operation that returns a result and can be cancelled.
Public methodStatic memberAsTask<TResult, TProgress>(IAsyncOperationWithProgress<TResult, TProgress>, CancellationToken, IProgress<TProgress>)Returns a task that represents a Windows Runtime asynchronous operation that returns a result, reports progress, and can be cancelled.
Public methodStatic memberGetAwaiter(IAsyncAction)Infrastructure. Returns an object that awaits an asynchronous action.
Public methodStatic memberGetAwaiter<TProgress>(IAsyncActionWithProgress<TProgress>)Infrastructure. Returns an object that awaits an asynchronous action that reports progress.
Public methodStatic memberGetAwaiter<TResult>(IAsyncOperation<TResult>)Infrastructure. Returns an object that awaits an asynchronous operation that returns a result.
Public methodStatic memberGetAwaiter<TResult, TProgress>(IAsyncOperationWithProgress<TResult, TProgress>)Infrastructure. Returns an object that awaits an asynchronous operation that reports progress and returns a result.
Top

The AsTask extension method overloads enable you to use a .NET Framework Task object to manage an asynchronous operation from the Windows Runtime.

The AsAsyncAction method and the AsAsyncOperation<TResult> method enable you to pass started tasks to methods that take Windows Runtime asynchronous actions and operations. See also the methods of the AsyncInfo class.

The GetAwaiter methods are used by compilers to implement the await operation (Await in Visual Basic).

.NET Framework

Supported in: 4.6, 4.5

Supported in: Windows Phone Silverlight 8

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft