Пример #1
0
 public void RunAllCommands()
 {
     if (PendingCommand != null)
     {
         AddCommandToExecute(PendingCommand);
         PendingCommand = null;
     }
     foreach (var command in _commandsToExecute)
     {
         command.Run.Invoke();
         if(command.Parameters!=null) Array.Clear(command.Parameters,0,command.Parameters.Length);
     }
     _commandsToExecute.Clear();
 }
Пример #2
0
 private void AddAllowedCommand(Command commandToAdd)
 {
     foreach (var sign in commandToAdd.Signature.Split(' ')) AllowedCommands.Add(sign, commandToAdd);
 }
Пример #3
0
 public void AddCommandToExecute(Command command)
 {
     _commandsToExecute.Add(command);
 }
Пример #4
0
        private Command command; // remains null if CommandBuilder receives invalid argument

        #endregion Fields

        #region Constructors

        //Asks CommandBuilder to create an instance for Command
        public Flag(string name)
        {
            command = builder.Create(name);
            commandArgs = new List<string>();
        }