Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            var presenter = new LongIdentifiePresenter(_consoleView);

            ConsoleCommandFactory.ConsoleView = _consoleView;

            ConsoleCommandFactory.RunCommand(ReadAlphaNumericIdentifierCommand.ReadAlphaNumericIdentifierKey);
            try
            {
                while (true)
                {
                    WriteCommandInfo();

                    var readedLine = Console.ReadLine();

                    if (string.IsNullOrEmpty(readedLine))
                    {
                        continue;
                    }

                    ConsoleCommandFactory.RunCommand(readedLine.ToLower());
                }
            }
            catch (ExitCommandException)
            {
            }
            catch (Exception e)
            {
                Console.WriteLine($"Во время выполнения программы возникла ошибка: {e}.");
                Console.ReadLine();
            }
        }
Exemplo n.º 2
0
 private static void WriteCommandInfo()
 {
     Console.WriteLine();
     ConsoleCommandFactory.GetCommandDescriptions().ForEach(Console.WriteLine);
 }