Ejemplo n.º 1
0
 public static void Main(string[] args)
 {
     try
     {
         ConsoleView consoleView = new ConsoleView();
         _presenterBuilder = new PresenterBuilder(consoleView);
         _presenterBuilder.Build();
         // Start application.
         consoleView.Start(args);
     }
     catch (InvalidDataException ex)
     {
         Console.Clear();
         Console.WriteLine(Application.ProductName + Resources.Space + Application.ProductVersion);
         Console.WriteLine(String.Empty);
         Console.WriteLine(@ex.Message);
         Console.WriteLine(String.Empty);
         Console.WriteLine(Resources.MessagePressAnyKeyToContinue);
         Console.ReadKey();
         Environment.Exit(255);
     }
     catch (XmlException ex)
     {
         Console.Clear();
         Console.WriteLine(Application.ProductName + Resources.Space + Application.ProductVersion);
         Console.WriteLine(String.Empty);
         Console.WriteLine(@ex.Message);
         Console.WriteLine(String.Empty);
         Console.WriteLine(Resources.MessagePressAnyKeyToContinue);
         Console.ReadKey();
         Environment.Exit(255);
     }
     catch (Exception ex)
     {
         Console.Clear();
         Console.WriteLine(Application.ProductName + Resources.Space + Application.ProductVersion);
         Console.WriteLine(String.Empty);
         Console.WriteLine(@Resources.MessageUnexpectedError,
                           @ex.Message);
         Console.WriteLine(String.Empty);
         Console.WriteLine(Resources.MessagePressAnyKeyToContinue);
         Console.ReadKey();
         Environment.Exit(255);
     }
     finally
     {
         if (_presenterBuilder != null)
         {
             _presenterBuilder.Dispose();
         }
     }
 }