Example #1
0
 public IStateBehaviour <TState, TInput> ExecuteOnExit(params Action <object>[] actions)
 {
     foreach (var action in actions)
     {
         _source.AddExitAction(_context.Factory.CreateActionHolder(action));
     }
     return(this);
 }
Example #2
0
        private void RegisterStateExitActions(IState <TState, TInput> state)
        {
            var actions = GetEntryOrExitActions(state, state.GetType(), typeof(StateExitActionAttribute));

            foreach (var action in actions)
            {
                var actionToInvoke = action;
                state.AddExitAction(_context.Factory
                                    .CreateActionHolder(param => actionToInvoke.Invoke(state, new object[] { param })));
            }
        }