AsyncResult Class

Definition

An abstract base class that implements the IAsyncResult interface. Serves as a base class from which to derive IAsyncResult objects that can be used for common asynchronous programming scenarios.

public ref class AsyncResult abstract : IAsyncResult, IDisposable
public abstract class AsyncResult : IAsyncResult, IDisposable
type AsyncResult = class
    interface IAsyncResult
    interface IDisposable
Public MustInherit Class AsyncResult
Implements IAsyncResult, IDisposable
Inheritance
AsyncResult
Derived
Implements

Remarks

For more information see the System.IAsyncResult interface.

The TypedAsyncResult<T> class derives from AsyncResult.

Constructors

AsyncResult()

Called from constructors in derived classes to initialize an instance of the AsyncResult class that does not have a callback delegate or a state object.

AsyncResult(AsyncCallback, Object)

Called from constructors in derived classes to initialize an instance of the AsyncResult class that has a callback delegate and a state object.

AsyncResult(Object)

Called from constructors in derived classes to initialize an instance of the AsyncResult class that does not have a callback delegate but does have a state object.

Properties

AsyncState

Gets a user-defined object that qualifies or contains information about an asynchronous operation.

AsyncWaitHandle

Gets a WaitHandle that is used to wait for an asynchronous operation to complete.

CompletedSynchronously

Gets a value that indicates whether the asynchronous operation completed synchronously.

IsCompleted

Gets a value that indicates whether the asynchronous operation has completed.

Methods

Complete(Boolean)

Call this version of complete when your asynchronous operation is complete and no exception was encountered. It updates the state of the operation and notifies the callback.

Complete(Boolean, Exception)

Call this version of complete if you raise an exception during processing. In addition to notifying the callback, it captures the exception and stores it to be thrown during the call to the End(IAsyncResult) method.

Dispose()

Releases the resources used by the current instance of the AsyncResult class.

Dispose(Boolean)

Called by the Dispose() and Finalize() methods to release the managed and unmanaged resources used by the current instance of the AsyncResult class.

End(IAsyncResult)

Call this method when the End function for the asynchronous operation is complete. It ensures that the asynchronous operation is complete, and does some common validation.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize()

Allows the AsyncResult object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to