Interaction logic for AskExitDialog.xaml
Inheritance: 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
ファイル: MainWindow.xaml.cs プロジェクト: kririae/Etupirka
        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);
		}