TransitionInfo.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #region --------------- Copyright Dresser Wayne Pignone -------------
  2. /*
  3. * $Log: /Wrk/WayneLibraries/Wrk/StateEngine/TransitionInfo.cs $
  4. *
  5. * 2 08-03-10 16:16 Mattias.larsson
  6. * Fixed summaries.
  7. *
  8. * 1 08-03-10 15:00 Mattias.larsson
  9. * Created.
  10. */
  11. #endregion
  12. using System;
  13. namespace Wayne.Lib.StateEngine
  14. {
  15. /// <summary>
  16. /// A class wrapping information about a transition.
  17. /// </summary>
  18. public class TransitionInfo
  19. {
  20. #region Fields
  21. private string fromStateFactoryName;
  22. private string transitionName;
  23. private string toStateFactoryName;
  24. private HistoryType historyType;
  25. #endregion
  26. #region Construction
  27. /// <summary>
  28. /// Constructor.
  29. /// </summary>
  30. /// <param name="fromStateFactoryName"></param>
  31. /// <param name="transitionName"></param>
  32. /// <param name="toStateFactoryName"></param>
  33. /// <param name="historyType"></param>
  34. public TransitionInfo(string fromStateFactoryName, string transitionName,
  35. string toStateFactoryName, HistoryType historyType)
  36. {
  37. this.fromStateFactoryName = fromStateFactoryName;
  38. this.transitionName = transitionName;
  39. this.toStateFactoryName = toStateFactoryName;
  40. this.historyType = historyType;
  41. }
  42. #endregion
  43. #region Properties
  44. /// <summary>
  45. /// The factory name of the "From" state.
  46. /// </summary>
  47. public string FromStateFactoryName
  48. {
  49. get { return fromStateFactoryName; }
  50. }
  51. /// <summary>
  52. /// The name of the transition.
  53. /// </summary>
  54. public string TransitionName
  55. {
  56. get { return transitionName; }
  57. }
  58. /// <summary>
  59. /// The factory name of the "To" state.
  60. /// </summary>
  61. public string ToStateFactoryName
  62. {
  63. get { return toStateFactoryName; }
  64. }
  65. /// <summary>
  66. /// The History Type.
  67. /// </summary>
  68. public HistoryType HistoryType
  69. {
  70. get { return historyType; }
  71. }
  72. #endregion
  73. #region Methods
  74. /// <summary>
  75. /// To string.
  76. /// </summary>
  77. /// <returns></returns>
  78. public override string ToString()
  79. {
  80. return string.Format("{0} >>{1}>> {2}", fromStateFactoryName, transitionName, toStateFactoryName);
  81. }
  82. #endregion
  83. }
  84. }