TplExtensions::ToApm<TResult> Method (Task<TResult>^, AsyncCallback^, Object^)

 

Converts a TPL task to the Asynchronous Programming Model (APM) Begin-End pattern.

Namespace:   Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

public:
generic<typename TResult>
[ExtensionAttribute]
static Task<TResult>^ ToApm(
	Task<TResult>^ task,
	AsyncCallback^ callback,
	Object^ state
)

Parameters

task
Type: System.Threading.Tasks::Task<TResult>^

The task that came from the asynchronous method.

callback
Type: System::AsyncCallback^

The optional callback to invoke when the task is completed.

state
Type: System::Object^

The state object provided by the caller of the Begin method.

Return Value

Type: System.Threading.Tasks::Task<TResult>^

A Task<TResult> (that implements IAsyncResult that should be returned from the Begin method.

Type Parameters

TResult

The result value to be returned from the End method.

Return to top
Show: