Creates a
Task that executes an end method action
when a specified
IAsyncResult completes.
Namespace:
System.Threading.Tasks
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Function FromAsync ( _
asyncResult As IAsyncResult, _
endMethod As Action(Of IAsyncResult) _
) As Task |
C# |
---|
public Task FromAsync(
IAsyncResult asyncResult,
Action<IAsyncResult> endMethod
) |
Parameters
- asyncResult
- Type: System..::.IAsyncResult
The IAsyncResult whose completion should trigger the processing of the
endMethod.
- endMethod
- Type: System..::.Action<(Of <(IAsyncResult>)>)
The action delegate that processes the completed asyncResult.
Return Value
A
Task that represents the asynchronous
operation.
Exceptions
Exception | Condition |
---|
System..::.ArgumentNullException | The exception that is thrown when the
asyncResult argument is null. |
System..::.ArgumentNullException | The exception that is thrown when the
endMethod argument is null. |
See Also