123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #region --------------- Copyright Dresser Wayne Pignone -------------
- #endregion
- using System;
- namespace Wayne.Lib.StateEngine
- {
-
-
-
- [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
- public class EventDescriptionAttribute : EnterDescriptionAttribute
- {
- #region Fields
- object eventType;
- #endregion
- #region Construction
-
-
-
-
-
- public EventDescriptionAttribute(object eventType, object transitionType)
- : this(eventType, "", transitionType)
- {
- this.eventType = eventType;
- }
-
-
-
-
-
-
- public EventDescriptionAttribute(object eventType, string conditionText, object transitionType)
- : base(conditionText, transitionType)
- {
- this.eventType = eventType;
- }
- #endregion
- #region Properties
-
-
-
- public object EventType
- {
- get { return eventType; }
- }
- #endregion
- #region IComparable Members
-
-
-
-
-
- public override int CompareTo(object obj)
- {
- int result = 0;
- EventDescriptionAttribute compareEventDescriptionAttribute = obj as EventDescriptionAttribute;
- if (compareEventDescriptionAttribute != null)
- {
- if ((EventType != null) && (compareEventDescriptionAttribute.EventType != null))
- {
-
-
- {
- result = EventType.ToString().CompareTo(compareEventDescriptionAttribute.EventType.ToString());
- if (result == 0)
- result = base.CompareTo(obj);
- }
- }
- else if (EventType != null)
- result = 1;
- else if (compareEventDescriptionAttribute.EventType != null)
- result = -1;
- }
- else
- {
- EnterDescriptionAttribute compareEnterDescriptionAttribute = obj as EnterDescriptionAttribute;
- if (compareEnterDescriptionAttribute != null)
- {
-
- return 1;
- }
- }
- return result;
- }
- #endregion
- }
- }
|