Beispiel #1
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (primaryForm != null)
         using (ErrorDialog ed = new ErrorDialog((Exception)e.ExceptionObject, false))
             ed.ShowDialog(primaryForm);
     else
     {
         System.IO.File.WriteAllText("SADXLVL2.log", e.ExceptionObject.ToString());
         MessageBox.Show("Unhandled Exception " + e.ExceptionObject.GetType().Name + "\nLog file has been saved.", "SADXLVL2 Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
 void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
 {
     using (ErrorDialog ed = new ErrorDialog(e.Exception, true))
         if (ed.ShowDialog(this) == DialogResult.Cancel)
             Close();
 }