public void Dispatch(SynchronizationEvent e) { if (this.history != null) { this.history.AddEvent(e.ToString()); } e.Execute(this); }
public void TraceInvalidEvent(SynchronizationEvent e, bool fatal) { if (DebugTrace.Error) { if (this.history != null) { DebugTrace.TxTrace(TraceLevel.Error, e.Enlistment.EnlistmentId, "The {0} was not expected by the {1} state. The state machine history history follows:\n\n{2}", e, this.current, this.history.ToString()); } else { DebugTrace.TxTrace(TraceLevel.Error, e.Enlistment.EnlistmentId, "The {0} was not expected by the {1} state", e, this.current); } } if (fatal) { FatalUnexpectedStateMachineEventRecord.TraceAndLog(this.enlistment.EnlistmentId, this.enlistment.Enlistment.RemoteTransactionId, this.ToString(), this.current.ToString(), this.history, e.ToString(), null); } else { NonFatalUnexpectedStateMachineEventRecord.TraceAndLog(this.enlistment.EnlistmentId, this.enlistment.Enlistment.RemoteTransactionId, this.ToString(), this.current.ToString(), this.history, e.ToString(), null); } }