private static void OnComplete(object parameter) { MsmqReceiveContext.ReceiveContextAsyncResult result = parameter as MsmqReceiveContext.ReceiveContextAsyncResult; Exception exception = null; Transaction current = null; try { current = Transaction.Current; Transaction.Current = result.associatedTransaction; result.receiver.OnComplete(result.timeoutHelper.RemainingTime()); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } exception = exception2; } finally { Transaction.Current = current; } result.Complete(false, exception); }
private static void OnAbandon(object parameter) { MsmqReceiveContext.ReceiveContextAsyncResult result = parameter as MsmqReceiveContext.ReceiveContextAsyncResult; Exception exception = null; try { result.receiver.OnAbandon(result.timeoutHelper.RemainingTime()); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } exception = exception2; } result.Complete(false, exception); }