static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Application.Run(new MainForm()); } catch (Exception ex) { var form = new AppCrashForm(); form.SetDetails(ex, "Aplicatia s-a inchis din cauza unor erori, doriti sa o reporniti?"); if (form.ShowDialog() == DialogResult.Yes) Application.Run(new MainForm()); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Application.Run(new MainForm()); } catch (Exception ex) { var form = new AppCrashForm(); form.SetDetails(ex, "Aplicatia s-a inchis din cauza unor erori, doriti sa o reporniti?"); if (form.ShowDialog() == DialogResult.Yes) { Application.Run(new MainForm()); } } }
private void timerDbCon_Tick(object sender, EventArgs e) { try { new Utilizator().IsConnectionAvailable(); } catch (Exception ex) { timerDbCon.Stop(); loginWindow.Close(); closeWithoutAskingFlag = true; var form = new AppCrashForm(); form.SetDetails(ex, "Aplicatia s-a inchis din cauza lipsei de conexiune cu baza de date, doriti sa o reporniti?"); if (form.ShowDialog() == DialogResult.Yes) { Application.Restart(); } else { Application.Exit(); } } }