// This method is invoked via the AsyncOperation object, // so it is guaranteed to be executed on the correct thread. private void ReportRequestDataCompleted(object operationState) { RequestDataCompletedEventArgs e = operationState as RequestDataCompletedEventArgs; OnRequestDataCompleted(e); }
private void CompletionMethod( byte[] responseData, Exception exception, bool canceled, AsyncOperation asyncOp) { // If the task was not previously canceled, // remove the task from the lifetime collection. if (!canceled) { lock (userStateToLifetime.SyncRoot) { userStateToLifetime.Remove(asyncOp.UserSuppliedState); } } RequestDataCompletedEventArgs e = new RequestDataCompletedEventArgs( responseData, exception, canceled, asyncOp.UserSuppliedState); // End the task. The asyncOp object is responsible // for marshaling the call. asyncOp.PostOperationCompleted(onRequestDataCompletedDelegate, e); // Note that after the call to OperationCompleted, // asyncOp is no longer usable, and any attempt to use it // will cause an exception to be thrown. }
protected void OnRequestDataCompleted( RequestDataCompletedEventArgs e) { if (RequestDataCompleted != null) { RequestDataCompleted(this, e); } }
protected void OnRequestDataCompleted( RequestDataCompletedEventArgs e) { if (RequestDataCompleted != null) { RequestDataCompleted(this, e); } }
private void CompletionMethod( byte[] responseData, Exception exception, bool canceled, AsyncOperation asyncOp) { // If the task was not previously canceled, // remove the task from the lifetime collection. if (!canceled) { lock (userStateToLifetime.SyncRoot) { userStateToLifetime.Remove(asyncOp.UserSuppliedState); } } RequestDataCompletedEventArgs e = new RequestDataCompletedEventArgs( responseData, exception, canceled, asyncOp.UserSuppliedState); // End the task. The asyncOp object is responsible // for marshaling the call. asyncOp.PostOperationCompleted(onRequestDataCompletedDelegate, e); // Note that after the call to OperationCompleted, // asyncOp is no longer usable, and any attempt to use it // will cause an exception to be thrown. }
void httper_RequestDataCompleted(object sender, RequestDataCompletedEventArgs e) { }