public static Exception AssertAndThrowFatal(string description) { Fx.Assert(description); throw Fx.Exception.AsError(new FatalException(description)); }
public TransactionSignalScope(AsyncResult result, Transaction transaction) { this.parent = result; this.transactionScope = Fx.CreateTransactionScope(transaction); }
public static Exception AssertAndThrow(string description) { Fx.Assert(description); throw Fx.Exception.AsError(new AssertionFailedException(description)); }
protected bool TryComplete(bool didCompleteSynchronously, Exception exception) { bool flag; lock (this.ThisLock) { if (!this.isCompleted) { this.exception = exception; this.isCompleted = true; goto Label0; } else { flag = false; } } return(flag); Label0: this.completedSynchronously = didCompleteSynchronously; if (this.OnCompleting != null) { try { this.OnCompleting(this, this.exception); } catch (Exception exception2) { Exception exception1 = exception2; if (Fx.IsFatal(exception1)) { throw; } this.exception = exception1; } } if (!didCompleteSynchronously) { lock (this.ThisLock) { if (this.manualResetEvent != null) { this.manualResetEvent.Set(); } } } if (this.callback != null) { try { if (this.VirtualCallback == null) { this.callback(this); } else { this.VirtualCallback(this.callback, this); } } catch (Exception exception4) { Exception exception3 = exception4; if (!Fx.IsFatal(exception3)) { throw Fx.Exception.AsError(new CallbackException(SRCore.AsyncCallbackThrewException, exception3), null); } throw; } } return(true); }