/// <summary>
 /// Initializes a new instance of the <see cref="StateMachineState{TState, TTransition, TPayload}"/> class.
 /// </summary>
 /// <param name="state">The state.</param>
 /// <param name="stateMachine">The state machine.</param>
 /// <param name="onEnter">The on enter method.</param>
 /// <param name="faultHandler">The fault handler.</param>
 public StateMachineState(
     TState state,
     StateMachineBase <TState, TTransition, TPayload> stateMachine,
     StateMachineDelegates.StateMachineEnterDel <TState, TTransition, TPayload> onEnter,
     Action <StateMachineContextBase <TState, TTransition, TPayload>, Exception> faultHandler)
 {
     this.State        = state;
     this.stateMachine = stateMachine;
     this.transitions  = new Dictionary <TTransition, StateMachineTransition <TState, TTransition, TPayload> >();
     this.OnEnter      = onEnter;
     this.faultHandler = faultHandler;
 }
示例#2
0
 public StateMachineTransition(
     TTransition current,
     StateMachineBase <TState, TTransition, TPayload> stateMachine,
     StateMachineState <TState, TTransition, TPayload> startState,
     StateMachineState <TState, TTransition, TPayload> endState,
     IEnumerable <StateMachineTransitionDel <TState, TTransition, TPayload> > onTransitionDelegate)
 {
     this.stateMachine         = stateMachine;
     this.startState           = startState;
     this.endState             = endState;
     this.onTransitionDelegate = onTransitionDelegate.ToList();
     this.Message = current;
 }