protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { e.Cancel = false; if (Settings.Default.askBeforeExit) { try { Dialog.AskExitDialog acd = new Dialog.AskExitDialog(); acd.Owner = this; e.Cancel = true; if (acd.ShowDialog() == true) { e.Cancel = false; if (acd.DoNotDisplay) { Settings.Default.askBeforeExit = false; Settings.Default.Save(); } } } catch { } } base.OnClosing(e); }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { //StreamWriter writer=new StreamWriter(@"D:\etupirka.log", true); //writer.WriteLine("test"); e.Cancel = false; if (Settings.Default.askBeforeExit) { try { Dialog.AskExitDialog acd = new Dialog.AskExitDialog(); acd.Owner = this; e.Cancel = true; if (acd.ShowDialog() == true) { e.Cancel = false; if (acd.DoNotDisplay) { Settings.Default.askBeforeExit = false; Settings.Default.Save(); } } } catch { } } base.OnClosing(e); }