Exemple #1
0
        public override void StartProcessing(string filePath)
        {
            DisplayConsole.ShowMessage("You can run commands from the console by removing the filepath argument when starting this application.");
            if (!File.Exists(filePath))
            {
                DisplayConsole.ShowMessage($"The file {filePath} does not exist.\r\n Please check that you have entered the proper path.");
                return;
            }

            DisplayConsole.ShowMessage($"Processing commands from {filePath}");
            var lines = File.ReadLines(filePath);

            foreach (var input in lines)
            {
                DisplayConsole.ShowMessage($"Command: {input}");
                if (string.IsNullOrEmpty(input))
                {
                    break;
                }
                else
                {
                    this.OnNext(input);
                }
            }
        }
 public override void StartProcessing(string parameter)
 {
     DisplayConsole.ShowMessage("You can use file input by typing RobotSimulor <FilePath>\r\nWaiting for command...\r\nPress ENTER to exit");
     while (true)
     {
         var input = Console.ReadLine();
         if (string.IsNullOrEmpty(input))
         {
             break;
         }
         else
         {
             this.OnNext(input);
         }
     }
 }