Exemplo n.º 1
0
 public IStateExitBehaviour <TState, TInput> ExecuteOnEntry(params Action <object>[] actions)
 {
     foreach (var action in actions)
     {
         _source.AddEntryAction(_context.Factory.CreateActionHolder(action));
     }
     return(this);
 }
Exemplo n.º 2
0
        private void RegisterStateEntryActions(IState <TState, TInput> state)
        {
            var actions = GetEntryOrExitActions(state, state.GetType(), typeof(StateEntryActionAttribute));

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