コード例 #1
0
        /// <summary>
        /// Initiates interaction with user through text UI
        /// </summary>
        public void Invoke(Storage Storage, XmlVehiclesReader VehiclesReader)
        {
            CommandsHandler commandsHandler = new CommandsHandler(Storage);

            Console.WriteLine("Press any key to enter path of an XML File to read and Esc to stop.");

            while (Console.ReadKey(true).Key != ConsoleKey.Escape)
            {
                string xmlPath = Console.ReadLine();
                Storage.AddVehicles(VehiclesReader.ReadVehicles(xmlPath));
            }

            while (exitFlag != true)
            {
                Console.WriteLine("Enter a command: ");
                commandsHandler.HandleCommand(Console.ReadLine());
            }
        }