See Also: AsyncOperation
When you implement a class according to the Event-based Asynchronous Pattern Overview, you may need to track the lifetime of each asynchronous operation invoked on an instance of your class. The AsyncOperation class provides ways to track and report the progress of an asynchronous task.
The following list identifies ways to use an AsyncOperation object:
To report progress and interim results to the client, call AsyncOperation.Post(SendOrPostCallback,Object) from your asynchronous worker code.
To indicate that an asynchronous task has completed, or to cancel a pending asynchronous task, call AsyncOperation.PostOperationCompleted(SendOrPostCallback,Object).
Your class should get an AsyncOperation object for each asynchronous task by calling AsyncOperationManager.CreateOperation(Object) when each task starts. To allow the client to distinguish separate asynchronous tasks, AsyncOperationManager.CreateOperation(Object) takes a parameter for a unique client-provided token, which becomes the AsyncOperation.UserSuppliedState property. It can then be used by client code to identify the particular asynchronous task that is raising progress or completion events.
Assembly: System (in System.dll)
Assembly Versions: 18.104.22.168, 22.214.171.124
Since: .NET 2.0
The members of System.ComponentModel.AsyncOperation are listed below.
See Also: Object