Exemple #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();
            }
        }
Exemple #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var view      = new IdViewForm();
            var presenter = new LongIdentifiePresenter(view);

            Application.Run(view);
        }