コード例 #1
0
 internal StateInner(string name, ITransitionDelegate <TState> transitionDelegate)
 {
     this.Name = name;
     this.transitionDelegate = transitionDelegate;
     this.Transitions        = new ReadOnlyCollection <ITransition <TState> >(this.transitions);
     this.Groups             = new ReadOnlyCollection <IStateGroup <TState> >(this.groups);
 }
コード例 #2
0
 public ForcedTransitionInvoker(TState toState, IEvent @event, ITransitionDelegate <TState> transitionDelegate)
 {
     this.toState            = toState;
     this.EventFireMethod    = EventFireMethod.Fire;
     this.Event              = @event;
     this.transitionDelegate = transitionDelegate;
 }
コード例 #3
0
 internal DynamicTransition(TState from, Event @event, Func <DynamicSelectorInfo <TState>, TState> stateSelector, ITransitionDelegate <TState> transitionDelegate)
 {
     this.From               = from;
     this.Event              = @event;
     this._stateSelector     = stateSelector;
     this.transitionDelegate = transitionDelegate;
 }
コード例 #4
0
 public ForcedTransitionInvoker(TState toState, IEvent @event, object eventData, ITransitionDelegate <TState> transitionDelegate)
 {
     this.toState = toState;
     // This is never actually references, but needs to be part of ITransitionInvoker
     this.EventFireMethod    = EventFireMethod.Fire;
     this.Event              = @event;
     this.EventData          = eventData;
     this.transitionDelegate = transitionDelegate;
 }
コード例 #5
0
        private Transition(TState from, TState to, Event @event, ITransitionDelegate <TState> transitionDelegate, bool isInnerTransition)
        {
            if (from.ParentStateMachine != to.ParentStateMachine)
            {
                throw new InvalidStateTransitionException(from, to);
            }

            this.transitionDelegate = transitionDelegate;
            this.From              = from;
            this.To                = to;
            this.Event             = @event;
            this.IsInnerTransition = isInnerTransition;
        }
コード例 #6
0
        public TransitionInner(TState from, TState to, TEvent @event, ITransitionDelegate <TState> transitionDelegate, bool isInnerTransition)
        {
            if (from.ParentStateMachine != to.ParentStateMachine)
            {
                throw new InvalidStateTransitionException(from, to);
            }

            if (from.ParentStateMachine != @event.ParentStateMachine && !from.ParentStateMachine.IsChildOf(@event.ParentStateMachine))
            {
                throw new InvalidEventTransitionException(from, @event);
            }

            this.From  = from;
            this.To    = to;
            this.Event = @event;
            this.transitionDelegate = transitionDelegate;
            this.IsInnerTransition  = isInnerTransition;
        }
コード例 #7
0
 internal static Transition <TState> CreateInner <TState>(TState fromAndTo, Event @event, ITransitionDelegate <TState> transitionDelegate) where TState : class, IState <TState>
 {
     return(new Transition <TState>(new TransitionInner <TState, Event, TransitionInfo <TState> >(fromAndTo, fromAndTo, @event, transitionDelegate, isInnerTransition: true)));
 }
コード例 #8
0
 internal static Transition <TState, TEventData> Create <TState, TEventData>(TState from, TState to, Event <TEventData> @event, ITransitionDelegate <TState> transitionDelegate) where TState : class, IState <TState>
 {
     return(new Transition <TState, TEventData>(new TransitionInner <TState, Event <TEventData>, TransitionInfo <TState, TEventData> >(from, to, @event, transitionDelegate, isInnerTransition: false)));
 }
コード例 #9
0
 public TransitionBuilder(TState fromState, Event @event, ITransitionDelegate <TState> transitionDelegate)
 {
     this.fromState          = fromState;
     this.@event             = @event;
     this.transitionDelegate = transitionDelegate;
 }
コード例 #10
0
 public IgnoredTransition(TState fromState, IEvent @event, ITransitionDelegate <TState> transitionDelegate)
 {
     this.transitionDelegate = transitionDelegate;
     this.fromState          = fromState;
     this.@event             = @event;
 }
コード例 #11
0
 public EventTransitionInvoker(Event @event, EventFireMethod eventFireMethod, ITransitionDelegate <TState> transitionDelegate)
 {
     this.@event             = @event;
     this.EventFireMethod    = eventFireMethod;
     this.transitionDelegate = transitionDelegate;
 }
コード例 #12
0
 internal Transition(TState fromAndTo, Event @event, ITransitionDelegate <TState> transitionDelegate)
     : this(fromAndTo, fromAndTo, @event, transitionDelegate, isInnerTransition : true)
 {
 }
コード例 #13
0
 internal Transition(TState from, TState to, Event @event, ITransitionDelegate <TState> transitionDelegate)
     : this(from, to, @event, transitionDelegate, isInnerTransition : false)
 {
 }