Exemplo n.º 1
0
 static void ShowErrorBox(Exception exception, string message, bool mustTerminate)
 {
     if (exception is System.InvalidOperationException)
         return;
     if (exception is System.InvalidProgramException)
         return;
     try
     {
         using (ExceptionBox box = new ExceptionBox(exception, message, mustTerminate))
         {
             try
             {
                 box.ShowDialog(SkyMap.Net.Gui.WorkbenchSingleton.MainForm);
             }
             catch (InvalidOperationException)
             {
                 box.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         LoggingService.Warn("Error showing ExceptionBox", ex);
         MessageBox.Show(exception.ToString());
     }
 }
Exemplo n.º 2
0
 private static void ShowErrorBox(Exception exception, string message, bool mustTerminate)
 {
     if (!(exception is InvalidOperationException) && !(exception is InvalidProgramException))
     {
         try
         {
             using (ExceptionBox box = new ExceptionBox(exception, message, mustTerminate))
             {
                 try
                 {
                     box.ShowDialog(WorkbenchSingleton.MainForm);
                 }
                 catch (InvalidOperationException)
                 {
                     box.ShowDialog();
                 }
             }
         }
         catch (Exception exception2)
         {
             LoggingService.Warn("Error showing ExceptionBox", exception2);
             MessageBox.Show(exception.ToString());
         }
     }
 }