Class AsyncResult<TResult>
Base class to encapsulates the results of an asynchronous operation that returns result.
public abstract class AsyncResult<TResult> : AsyncResult, IAsyncResult
Type Parameters
TResultThe type of the result.
- Inheritance
-
AsyncResult<TResult>
- Implements
- Derived
- Inherited Members
Constructors
AsyncResult(AsyncCallback, object)
Initializes a new instance of the AsyncResult<TResult> class.
protected AsyncResult(AsyncCallback asyncCallback, object state)
Parameters
asyncCallbackAsyncCallbackThe async callback.
stateobjectThe state.
Methods
EndInvoke()
Waits until the asynchronous operation completes, and then returns the value generated by the asynchronous operation.
public TResult EndInvoke()
Returns
- TResult
The invocation result.
SetAsCompleted(TResult, bool)
Marks asynchronous operation as completed.
public void SetAsCompleted(TResult result, bool completedSynchronously)