Exemplo n.º 1
0
        public static void Run(ApplicationViewModel application)
        {
            if (ConsoleInstance != null)
            {
                throw new InvalidOperationException("Console UI is already running!");
            }

            ConsoleInstance = new ConsoleUI(application);

            ConsoleInstance.ComponentLibraryScannningWaiter.Wait();

            ConsoleInstance.DisplayExistingLogs();
            ConsoleInstance.StartListenToLogEvents();

            ConsoleInstance.Exit = false;

            while (!ConsoleInstance.Exit)
            {
                Console.Write("#> ");
                string input = Console.ReadLine();
                if (ConsoleInstance.ParseInput(input) == false)
                {
                    Console.WriteLine("Command is incorrect. Display commands using ?");
                }
            }

            //cleanup
            LogViewModel.DestroyLogTargets();
        }