Compartir a través de


TplExtensions.ToApm Method

Definition

Overloads

ToApm(Task, AsyncCallback, Object)

Converts a TPL task to the APM Begin-End pattern.

ToApm<TResult>(Task<TResult>, AsyncCallback, Object)

Converts a TPL task to the APM Begin-End pattern.

ToApm(Task, AsyncCallback, Object)

Converts a TPL task to the APM Begin-End pattern.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ ToApm(System::Threading::Tasks::Task ^ task, AsyncCallback ^ callback, System::Object ^ state);
public static System.Threading.Tasks.Task ToApm (this System.Threading.Tasks.Task task, AsyncCallback callback, object state);
public static System.Threading.Tasks.Task ToApm (this System.Threading.Tasks.Task task, AsyncCallback? callback, object? state);
static member ToApm : System.Threading.Tasks.Task * AsyncCallback * obj -> System.Threading.Tasks.Task
<Extension()>
Public Function ToApm (task As Task, callback As AsyncCallback, state As Object) As Task

Parameters

task
Task

The task that came from the async method.

callback
AsyncCallback

The optional callback to invoke when the task is completed.

state
Object

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

Returns

A task (that implements IAsyncResult that should be returned from the Begin method.

Applies to

ToApm<TResult>(Task<TResult>, AsyncCallback, Object)

Converts a TPL task to the APM Begin-End pattern.

public:
generic <typename TResult>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<TResult> ^ ToApm(System::Threading::Tasks::Task<TResult> ^ task, AsyncCallback ^ callback, System::Object ^ state);
public static System.Threading.Tasks.Task<TResult> ToApm<TResult> (this System.Threading.Tasks.Task<TResult> task, AsyncCallback callback, object state);
public static System.Threading.Tasks.Task<TResult> ToApm<TResult> (this System.Threading.Tasks.Task<TResult> task, AsyncCallback? callback, object? state);
static member ToApm : System.Threading.Tasks.Task<'Result> * AsyncCallback * obj -> System.Threading.Tasks.Task<'Result>
<Extension()>
Public Function ToApm(Of TResult) (task As Task(Of TResult), callback As AsyncCallback, state As Object) As Task(Of TResult)

Type Parameters

TResult

The result value to be returned from the End method.

Parameters

task
Task<TResult>

The task that came from the async method.

callback
AsyncCallback

The optional callback to invoke when the task is completed.

state
Object

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

Returns

Task<TResult>

A task (that implements IAsyncResult that should be returned from the Begin method.

Applies to