Interaction logic for AskExitDialog.xaml
Inheritance: MahApps.Metro.Controls.MetroWindow
Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
		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);
		}