Ejemplo n.º 1
0
        private void EvalInputString(string inputString)
        {
            inputString = inputString.Trim();

            if (string.IsNullOrEmpty(inputString))
            {
                LogMessage(ConsoleMessage.Debug(string.Empty));
                return;
            }

            _history.Add(inputString);
            LogMessage(ConsoleMessage.Debug(inputString));

            var input = new List <string>(inputString.Split(new [] { ' ' }, System.StringSplitOptions.RemoveEmptyEntries));

            input = input.Select(low => low.ToLower()).ToList();
            var cmd = input[0];

            if (CommandController.Contains(cmd))
            {
                CommandController[cmd].Execute(input.ToArray())
                .ObserveOnMainThread()
                .Subscribe(r => LogMessage(ConsoleMessage.Info(r)));
            }
            else
            {
                LogMessage(ConsoleMessage.Info(string.Format("*** Unknown Command: {0} ***", cmd)));
            }
        }