AsyncResult AsyncResult AsyncResult 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
AsyncResultAsyncResultAsyncResultAsyncResult
Derived
Implements

Remarks

For more information see the System.IAsyncResult interface.

The TypedAsyncResult<T> class derives from AsyncResult.

Constructors

AsyncResult() AsyncResult() AsyncResult() 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) AsyncResult(AsyncCallback, Object) AsyncResult(AsyncCallback, 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) AsyncResult(Object) AsyncResult(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 AsyncState AsyncState AsyncState

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

AsyncWaitHandle AsyncWaitHandle AsyncWaitHandle AsyncWaitHandle

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

CompletedSynchronously CompletedSynchronously CompletedSynchronously CompletedSynchronously

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

IsCompleted IsCompleted IsCompleted IsCompleted

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

Methods

Complete(Boolean) Complete(Boolean) Complete(Boolean) 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) Complete(Boolean, Exception) Complete(Boolean, Exception) 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() Dispose() Dispose() Dispose()

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

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) 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) End(IAsyncResult) End(IAsyncResult) 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) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

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

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to