예제 #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>();
        }