Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.
Public Function FromAsync(Of TArg1, TArg2) ( _ beginMethod As Func(Of TArg1, TArg2, AsyncCallback, Object, IAsyncResult), _ endMethod As Action(Of IAsyncResult), _ arg1 As TArg1, _ arg2 As TArg2, _ state As Object _ ) As Task
public Task FromAsync<TArg1, TArg2>( Func<TArg1, TArg2, AsyncCallback, Object, IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, Object state )
public: generic<typename TArg1, typename TArg2> Task^ FromAsync( Func<TArg1, TArg2, AsyncCallback^, Object^, IAsyncResult^>^ beginMethod, Action<IAsyncResult^>^ endMethod, TArg1 arg1, TArg2 arg2, Object^ state )
member FromAsync : beginMethod:Func<'TArg1, 'TArg2, AsyncCallback, Object, IAsyncResult> * endMethod:Action<IAsyncResult> * arg1:'TArg1 * arg2:'TArg2 * state:Object -> Task
The type of the first argument passed to the beginMethod delegate.
The type of the second argument passed to beginMethod delegate.
The exception that is thrown when the beginMethod argument is null.
-or-
The exception that is thrown when the endMethod argument is null.
This method throws any exceptions thrown by the beginMethod.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2