コード例 #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);
        }