123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- #region --------------- Copyright Dresser Wayne Pignone -------------
- #endregion
- #region Old file header
- #endregion
- using System;
- using System.Text;
- namespace Wayne.Lib.StateEngine
- {
-
-
-
-
-
-
-
- public class StateEntry
- {
- #region Fields
- private Transition sourceTransition;
- private string targetStateFactoryName;
- private HistoryType historyType;
- #endregion
- #region Construction
-
-
-
-
-
-
- public StateEntry(Transition sourceTransition, string targetStateFactoryName, HistoryType historyType)
- {
- this.sourceTransition = sourceTransition;
- this.targetStateFactoryName = targetStateFactoryName;
- this.historyType = historyType;
- }
- #endregion
- #region Properties
-
-
-
- public Transition SourceTransition
- {
- get { return sourceTransition; }
- }
-
-
-
- public string TargetStateFactoryName
- {
- get { return targetStateFactoryName; }
- }
-
-
-
- public HistoryType HistoryType
- {
- get { return historyType; }
- }
- #endregion
-
-
-
-
- public string GetStateInformation()
- {
- var stringBuilder = new StringBuilder();
- if (SourceTransition != null)
- {
- if (SourceTransition.Sender != null)
- stringBuilder.Append(string.Format("Came from: {0}.", SourceTransition.Sender.FactoryName));
- if (SourceTransition.SourceEvent != null)
- stringBuilder.Append(string.Format("Triggered by: {0}.", SourceTransition.Sender));
- ExceptionTransition exceptionTransition = SourceTransition as ExceptionTransition;
- if (exceptionTransition != null)
- {
- stringBuilder.Append(string.Format("Exception thrown: {0}.", exceptionTransition.Exception));
- }
- }
- return stringBuilder.ToString();
- }
- }
- }
|