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
TResult
The 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
asyncCallback
AsyncCallbackThe async callback.
state
objectThe 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)