AsyncInfo Class

.NET Framework 4.5

Provides factory methods to construct representations of managed tasks that are compatible with Windows Runtime asynchronous actions and operations.

This API is not CLS-compliant. 

System.Object
  System.Runtime.InteropServices.WindowsRuntime.AsyncInfo

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

[CLSCompliantAttribute(false)]
public static class AsyncInfo

  NameDescription
Public methodStatic memberSupported in .NET for Windows Store appsRun(Func<CancellationToken, Task>)Creates and starts a Windows Runtime asynchronous action by using a function that generates a started task. The task can support cancellation.
Public methodStatic memberSupported in .NET for Windows Store appsRun<TResult>(Func<CancellationToken, Task<TResult>>)Creates and starts a Windows Runtime asynchronous operation by using a function that generates a started task that returns results. The task can support cancellation.
Public methodStatic memberSupported in .NET for Windows Store appsRun<TProgress>(Func<CancellationToken, IProgress<TProgress>, Task>)Creates and starts a Windows Runtime asynchronous action that includes progress updates, by using a function that generates a started task. The task can support cancellation and progress reporting.
Public methodStatic memberSupported in .NET for Windows Store appsRun<TResult, TProgress>(Func<CancellationToken, IProgress<TProgress>, Task<TResult>>)Creates and starts a Windows Runtime asynchronous operation that includes progress updates, by using a function that generates a started task that returns results. The task can support cancellation and progress reporting.
Top

The factory methods take functions (represented by delegates) that create and start managed Task or Task<TResult> objects. When a factory method is called, it invokes the delegate to create a started task, and then creates a Windows Runtime asynchronous action or operation that represents the task. Each factory method returns one of the sub-interfaces of Windows.Foundation.IAsyncInfo.

The WindowsRuntimeSystemExtensions class provides the AsTask extension method overloads to convert Windows Runtime asynchronous actions and operations to tasks, and the AsAsyncAction and AsAsyncOperation<TResult> extension methods that convert started tasks to Windows Runtime actions and operations.

.NET Framework

Supported in: 4.5

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone Silverlight 8

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft