123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- /*===============================================================================
- * 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
- {
- /// <summary>
- /// Categorizes the log entries in the OnLog event from the State machine.
- /// </summary>
- public enum LogType
- {
- /// <summary>
- /// Logging when a state entry is performed.
- /// </summary>
- Enter,
- /// <summary>
- /// Logging when a state exit is performed.
- /// </summary>
- Exit,
- /// <summary>
- /// Logging when an event is sent into a state for handling.
- /// </summary>
- HandleEvent,
- /// <summary>
- /// Logging when an exception has been unhandled in the user code.
- /// </summary>
- Error,
- /// <summary>
- /// Misc. debug logging.
- /// </summary>
- Debug,
- /// <summary>
- /// Warnings about unhandled transitions.
- /// </summary>
- UnhandledTransition,
- }
- /// <summary>
- /// 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.
- /// </summary>
- public sealed class LogEventArgs : EventArgs
- {
- #region Fields
- LogType logType;
- string logText;
- #endregion
- #region Construction
- /// <summary>
- /// Initializes a new instance of the LogEventArgs class.
- /// </summary>
- /// <param name="logType">Category of this log entry.</param>
- /// <param name="logText">Text to be logged.</param>
- internal LogEventArgs(LogType logType, string logText)
- {
- this.logText = logText;
- this.logType = logType;
- }
- #endregion
- #region Properties
- /// <summary>
- /// The log text from the Statemachine.
- /// </summary>
- public string LogText
- {
- get { return logText; }
- }
- /// <summary>
- /// Category of the log entry.
- /// </summary>
- public LogType LogType
- {
- get { return logType; }
- }
- #endregion
- }
- }
|