Example #1
0
        // 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);
        }
Example #2
0
        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.
        }
Example #3
0
 protected void OnRequestDataCompleted(
     RequestDataCompletedEventArgs e)
 {
     if (RequestDataCompleted != null)
     {
         RequestDataCompleted(this, e);
     }
 }
Example #4
0
 protected void OnRequestDataCompleted(
     RequestDataCompletedEventArgs e)
 {
     if (RequestDataCompleted != null)
     {
         RequestDataCompleted(this, e);
     }
 }
Example #5
0
        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.
        }
Example #6
0
 void httper_RequestDataCompleted(object sender, RequestDataCompletedEventArgs e)
 {
 }