Beispiel #1
0
        internal void Execute(string line)
        {
            string[] split = line.Split(' ');

            string cmd = split[0];

            string[] args = new string[split.Length - 1];
            for (int i = 1; i < split.Length; i++)
            {
                args[i - 1] = split[i];
            }

            ITerminalCommand command = _commands[cmd];

            command.Execute(args);
        }
        public void Consume(ITerminalCommand terminalCommand)
        {
            terminalCommand.Execute(this, (text) =>
            {
                FireTerminalCommandExecuting(terminalCommand, text);
            });

            if (terminalCommand.Handled)
            {
                FireTerminalCommandDidExecuted(terminalCommand);
                return;
            }

            foreach (var innerTerminalCommandChannel in InnerTerminalCommandChannels)
            {
                innerTerminalCommandChannel.Consume(terminalCommand);

                if (terminalCommand.Handled)
                {
                    return;
                }
            }
        }