예제 #1
0
        public ISchematicBuilder <TState, TInput> WithStates(params TState[] states)
        {
            foreach (var state in states)
            {
                var stateConfiguration = new StateBuilder <TState, TInput>(this, state);

                _stateConfigurations.Add(state, stateConfiguration);
            }

            return(this);
        }
예제 #2
0
        public ISchematicBuilder <TState, TInput> WithState(
            TState state,
            System.Action <IStateBuilder <TState, TInput> > stateBuilderAction = null)
        {
            var stateConfiguration = new StateBuilder <TState, TInput>(this, state);

            _stateConfigurations.Add(stateConfiguration.Value, stateConfiguration);

            stateBuilderAction?.Invoke(stateConfiguration);

            return(this);
        }
예제 #3
0
        public ISchematicBuilder <TState, TInput> WithStates(
            ICollection <TState> states,
            System.Action <IStateBuilder <TState, TInput> > stateBuilderAction = null)
        {
            foreach (var state in states)
            {
                var stateConfiguration = new StateBuilder <TState, TInput>(this, state);

                _stateConfigurations.Add(state, stateConfiguration);
            }

            foreach (var state in states)
            {
                var stateConfiguration = _stateConfigurations[state];

                stateBuilderAction?.Invoke(stateConfiguration);
            }

            return(this);
        }