예제 #1
0
        public IRule Return(IEnumerable<StateCreationRule> stateCreationRules, CreateNextStateDelegate defaultCreateNextStateDelegate = null)
        {
            Check.IsNotNull(stateCreationRules, "stateCreationRules");

            if (defaultCreateNextStateDelegate == null)
            {
                return new Rule(condition, requestAction, new StateFactoryCollection(stateCreationRules));
            }

            var stateFactoryCollection = new StateFactoryCollection(stateCreationRules, (r, v, c) => defaultCreateNextStateDelegate(r, v));
            return new Rule(condition, requestAction, stateFactoryCollection);
        }
예제 #2
0
 public CreateNextState(CreateNextStateDelegate createNextStateDelegate)
 {
     this.createNextStateDelegate = createNextStateDelegate;
 }
예제 #3
0
 public IRule ReturnState(CreateNextStateDelegate createNextStateDelegate)
 {
     return new Rule(condition, requestAction, new CreateNextState(createNextStateDelegate));
 }
예제 #4
0
 public StateCreationRule Do(CreateNextStateDelegate createNextStateDelegate)
 {
     return new StateCreationRule(condition, new CreateNextState(createNextStateDelegate));
 }