/// <summary> /// The main method for running the application. /// </summary> public void Run() { //bool isFirstRun = true; Console.CancelKeyPress += new ConsoleCancelEventHandler(ControlCHandler); _view.ShowWelcomeScreen(); _view.ShowMainMenu(); AdminCommand command; while (true) { //Console.Clear(); //if (isFirstRun) //{ // _view.ShowWelcomeScreen(); // _view.ShowMainMenu(); // isFirstRun = false; //} else //{ // Console.WriteLine(TextProcessor.LOGO); //} // TODO Improve usability by clearng console every loop Console.Clear(); if (_repository == null) { Console.Clear(); Console.WriteLine("Repository is null\t\tWARNING!"); break; } if (_view == null) { Console.Clear(); Console.WriteLine("View is null\t\tWARNING!"); break; } _view.ShowPrompt(); string input = Console.ReadLine(); command = CommandFactory.GetCommand(input); command.Invoke(_repository, _view); } }