private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { ExitQuestion dlg = null; Properties.Settings.Default.WindowState = WindowState; if (WindowState == FormWindowState.Normal) { Properties.Settings.Default.WindowSize = Size; Properties.Settings.Default.WindowLocation = Location; } else { Properties.Settings.Default.WindowSize = RestoreBounds.Size; Properties.Settings.Default.WindowLocation = RestoreBounds.Location; } if (Properties.Settings.Default.AskForTerminate) { TimeSpan time = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second).Subtract (StartTime); dlg = new ExitQuestion(time, NumberOfEdits, ""); dlg.ShowDialog(); Properties.Settings.Default.AskForTerminate = !dlg.CheckBoxDontAskAgain; } // save user persistent settings Properties.Settings.Default.Save(); if (dlg != null) { switch (dlg.DialogResult) { case DialogResult.OK: CloseDownAWB(); break; case DialogResult.Cancel: e.Cancel = true; break; } } else if (!Properties.Settings.Default.AskForTerminate) { CloseDownAWB(); } else { e.Cancel = true; } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { ExitQuestion dlg = null; WebControl.Shutdown = true; Properties.Settings.Default.WindowState = this.WindowState; if (this.WindowState == FormWindowState.Normal) { Properties.Settings.Default.WindowSize = this.Size; Properties.Settings.Default.WindowLocation = this.Location; } else { Properties.Settings.Default.WindowSize = this.RestoreBounds.Size; Properties.Settings.Default.WindowLocation = this.RestoreBounds.Location; } Properties.Settings.Default.Save(); if (AutoWikiBrowser.Properties.Settings.Default.AskForTerminate) { TimeSpan time = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); time = time.Subtract(StartTime); dlg = new ExitQuestion(time, NumberOfEdits, ""); dlg.ShowDialog(); AutoWikiBrowser.Properties.Settings.Default.AskForTerminate = !dlg.CheckBoxDontAskAgain; } if (!AutoWikiBrowser.Properties.Settings.Default.AskForTerminate || dlg.DialogResult == DialogResult.OK) { // save user persistent settings AutoWikiBrowser.Properties.Settings.Default.Save(); if (webBrowserEdit.IsBusy) webBrowserEdit.Stop2(); if (Variables.User.webBrowserLogin.IsBusy) Variables.User.webBrowserLogin.Stop(); SaveRecentSettingsList(); UsageStats.Do(true); } else { e.Cancel = true; return; } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { ExitQuestion dlg = null; WebControl.Shutdown = true; Properties.Settings.Default.WindowState = WindowState; if (WindowState == FormWindowState.Normal) { Properties.Settings.Default.WindowSize = Size; Properties.Settings.Default.WindowLocation = Location; } else { Properties.Settings.Default.WindowSize = RestoreBounds.Size; Properties.Settings.Default.WindowLocation = RestoreBounds.Location; } Properties.Settings.Default.Save(); if (Properties.Settings.Default.AskForTerminate) { TimeSpan time = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); time = time.Subtract(StartTime); dlg = new ExitQuestion(time, NumberOfEdits, ""); dlg.ShowDialog(); Properties.Settings.Default.AskForTerminate = !dlg.CheckBoxDontAskAgain; } if (!Properties.Settings.Default.AskForTerminate || (dlg != null && dlg.DialogResult == DialogResult.OK)) { ShuttingDown = true; // save user persistent settings Properties.Settings.Default.Save(); try { if (webBrowserEdit.IsBusy) webBrowserEdit.Stop2(); if (Variables.User.WebBrowserLogin.IsBusy) Variables.User.WebBrowserLogin.Stop(); } catch { } // simply suppress IE silliness SaveRecentSettingsList(); UsageStats.Do(true); } else { e.Cancel = true; return; } ntfyTray.Dispose(); }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { ExitQuestion dlg = null; Properties.Settings.Default.WindowState = WindowState; if (WindowState == FormWindowState.Normal) { Properties.Settings.Default.WindowSize = Size; Properties.Settings.Default.WindowLocation = Location; } else { Properties.Settings.Default.WindowSize = RestoreBounds.Size; Properties.Settings.Default.WindowLocation = RestoreBounds.Location; } Properties.Settings.Default.Save(); if (Properties.Settings.Default.AskForTerminate) { TimeSpan time = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); time = time.Subtract(StartTime); dlg = new ExitQuestion(time, NumberOfEdits, ""); dlg.ShowDialog(); Properties.Settings.Default.AskForTerminate = !dlg.CheckBoxDontAskAgain; } if (!Properties.Settings.Default.AskForTerminate || (dlg != null && dlg.DialogResult == DialogResult.OK)) { ShuttingDown = true; // save user persistent settings Properties.Settings.Default.Save(); TheSession.Editor.Abort(); SaveRecentSettingsList(); UsageStats.Do(true); } else { e.Cancel = true; return; } ntfyTray.Dispose(); }