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