Interaction logic for AskExitDialog.xaml
상속: MahApps.Metro.Controls.MetroWindow
예제 #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);
        }
예제 #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);
        }
예제 #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);
		}