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); }
public void EndFinishOperation(IAsyncResult result) { FinishOperationAsyncResult.End(result); }