/*=============================================================================== * Change history * When Who TaskId Comment * ---------- ------ ------ ------------------------------------ * 2006-08-08 RMa Added LogType to the log event args. * 2006-05-17 RMa Created * ---------------------------------------------------------------------------------*/ using System; using System.Collections.Generic; using System.Text; namespace Wayne.Lib.StateEngine { /// /// Categorizes the log entries in the OnLog event from the State machine. /// public enum LogType { /// /// Logging when a state entry is performed. /// Enter, /// /// Logging when a state exit is performed. /// Exit, /// /// Logging when an event is sent into a state for handling. /// HandleEvent, /// /// Logging when an exception has been unhandled in the user code. /// Error, /// /// Misc. debug logging. /// Debug, /// /// Warnings about unhandled transitions. /// UnhandledTransition, } /// /// The Log Event args is used to carry log strings when logging internally in the /// state machine. Applications can hook on the StateMachine.OnLog event in order to /// catch loggins from the inner workings of the statemachine. /// public sealed class LogEventArgs : EventArgs { #region Fields LogType logType; string logText; #endregion #region Construction /// /// Initializes a new instance of the LogEventArgs class. /// /// Category of this log entry. /// Text to be logged. internal LogEventArgs(LogType logType, string logText) { this.logText = logText; this.logType = logType; } #endregion #region Properties /// /// The log text from the Statemachine. /// public string LogText { get { return logText; } } /// /// Category of the log entry. /// public LogType LogType { get { return logType; } } #endregion } }