C# Class WebApplications.Utilities.Threading.AsyncResult

Inheritance: IAsyncResult
Afficher le fichier Open project: webappsuk/CoreLibraries Class Usage Examples

Private Properties

Свойство Type Description
AsyncCallbackCompleteOpHelperNoReturnValue void
CallingThreadShouldSetTheEvent bool
CompleteOpHelper void
WaitCallbackCompleteOpHelperNoReturnValue void

Méthodes publiques

Méthode Description
AsyncResult ( AsyncCallback asyncCallback, object state ) : System

Initializes a new instance of the AsyncResult class.

AsyncResult ( AsyncCallback asyncCallback, object state, object initiatingObject ) : System

Initializes a new instance of the AsyncResult class.

EndInvoke ( ) : void

Frees up the resources used by the asynchronous operation. If the asynchronous operation failed then this method throws the exception.

SetAsCancelled ( ) : void

Set the status of the asynchronous operation to cancelled.

SetAsCompleted ( Exception exception = null, bool completedSynchronously = false ) : void

Set the status of the asynchronous operation to completed.

Méthodes protégées

Méthode Description
BeginInvokeOnWorkerThread ( ) : IAsyncResult

Returns the status of an operation that was queued to the thread pool.

GetAsyncCallbackHelper ( ) : AsyncCallback

Returns a single delegate to a method that will invoke the desired AsyncCallback

OnCompleteOperation ( IAsyncResult result ) : void

Private Methods

Méthode Description
AsyncCallbackCompleteOpHelperNoReturnValue ( [ otherAsyncResult ) : void
CallingThreadShouldSetTheEvent ( ) : bool
CompleteOpHelper ( IAsyncResult ar ) : void

A helper function used to run the callback on the completed asynchronous operation.

WaitCallbackCompleteOpHelperNoReturnValue ( [ o ) : void

Method Details

AsyncResult() public méthode

Initializes a new instance of the AsyncResult class.
public AsyncResult ( AsyncCallback asyncCallback, object state ) : System
asyncCallback AsyncCallback The method to execute once the operation completes.
state object /// The object that can be obtained via the property. ///
Résultat System

AsyncResult() public méthode

Initializes a new instance of the AsyncResult class.
public AsyncResult ( AsyncCallback asyncCallback, object state, object initiatingObject ) : System
asyncCallback AsyncCallback The method that should be executed when the operation completes.
state object The object that can be obtained via the AsyncState property.
initiatingObject object /// The object that is initiating the asynchronous operation. /// This is stored in the property. ///
Résultat System

BeginInvokeOnWorkerThread() protected méthode

Returns the status of an operation that was queued to the thread pool.
protected BeginInvokeOnWorkerThread ( ) : IAsyncResult
Résultat IAsyncResult

EndInvoke() public méthode

Frees up the resources used by the asynchronous operation. If the asynchronous operation failed then this method throws the exception.
public EndInvoke ( ) : void
Résultat void

GetAsyncCallbackHelper() protected static méthode

Returns a single delegate to a method that will invoke the desired AsyncCallback
protected static GetAsyncCallbackHelper ( ) : AsyncCallback
Résultat AsyncCallback

OnCompleteOperation() protected méthode

protected OnCompleteOperation ( IAsyncResult result ) : void
result IAsyncResult
Résultat void

SetAsCancelled() public méthode

Set the status of the asynchronous operation to cancelled.
public SetAsCancelled ( ) : void
Résultat void

SetAsCompleted() public méthode

Set the status of the asynchronous operation to completed.
The operation result has already been set previously.
public SetAsCompleted ( Exception exception = null, bool completedSynchronously = false ) : void
exception System.Exception /// If non-null then this identifies the exception that occurred while processing the asynchronous operation. ///
completedSynchronously bool Indicates whether the operation completed synchronously or asynchronously.
Résultat void