Exemplo n.º 1
0
 private Console()
 {
     ConsoleInputHistory = new ConsoleInputHistory(InputHistoryCapacity);
     CommandQueue        = new Queue <QueuedCommand>();
     Commands            = new CommandTree();
     RegisterAttributes();
 }
Exemplo n.º 2
0
        private void Add(string[] commands, int index, CommandAttribute cmd)
        {
            if (commands.Length == index)
            {
                Command = cmd;
                return;
            }

            string token = commands[index];

            if (!SubCommands.ContainsKey(token))
            {
                SubCommands[token] = new CommandTree();
            }
            SubCommands[token].Add(commands, index + 1, cmd);
        }