Пример #1
0
        internal void AddCommand(ConfigCommand command, string value)
        {
            var argument = new Argument
            {
                Value = value
            };

            argument.Arguments.AddRange(command.Commands);

            commands.Arguments.Add(argument);
        }
Пример #2
0
        /// <summary>
        /// Sets the commands.
        /// </summary>
        /// <param name="command">The commands.</param>
        public IConfigureArgument Command(string command)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            command = command.Trim();

            if (string.IsNullOrEmpty(command))
            {
                throw new ArgumentException($"Argument '{nameof(command)}' cannot be empty.");
            }

            var configCommand = new ConfigCommand();

            configCommand.Commands.Add(command);
            var configureCommand = new ConfigureCommand(this, configCommand);

            configuration.Commands.Add(configCommand);

            return(configureCommand);
        }