Example #1
0
            static void HandleOperationCompletion(OperationType operation, IAsyncResult result)
            {
                if (result.CompletedSynchronously)
                {
                    return;
                }

                Fx.Assert(result.AsyncState is FinishOperationAsyncResult,
                          "Async state should have been FinishOperationAsyncResult");

                FinishOperationAsyncResult finishResult = (FinishOperationAsyncResult)result.AsyncState;

                Exception completionException = null;

                try
                {
                    finishResult.CallEndOperation(operation, result);
                }
                catch (Exception e)
                {
                    if (Fx.IsFatal(e))
                    {
                        throw;
                    }

                    completionException = e;
                }

                finishResult.Complete(false, completionException);
            }
Example #2
0
 public void EndFinishOperation(IAsyncResult result)
 {
     FinishOperationAsyncResult.End(result);
 }