共用方式為


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

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function ToApm(Of TResult) ( _
    task As Task(Of TResult), _
    callback As AsyncCallback, _
    state As Object _
) As Task(Of TResult)
public static Task<TResult> ToApm<TResult>(
    this Task<TResult> task,
    AsyncCallback callback,
    Object state
)
[ExtensionAttribute]
public:
generic<typename TResult>
static Task<TResult>^ ToApm(
    Task<TResult>^ task, 
    AsyncCallback^ callback, 
    Object^ state
)
static member ToApm : 
        task:Task<'TResult> * 
        callback:AsyncCallback * 
        state:Object -> Task<'TResult> 
JScript does not support generic types or methods.

Type Parameters

  • TResult

Parameters

Return Value

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

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Task<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).

.NET Framework Security

See Also

Reference

TplExtensions Class

ToApm Overload

Microsoft.VisualStudio.Threading Namespace