Esempio n. 1
0
 protected virtual void OnClosing(WindowClosingEventArgs e)
 {
     if (Closing != null)
     {
         Closing.Invoke(this, e);
     }
 }
Esempio n. 2
0
        private void Manager_WindowClosing(object sender, WindowClosingEventArgs e)
        {
            e.Cancel = !mExit && mExitConfirmation;

            if (!mExit && mExitConfirmation && mExitDialog == null)
            {
                mExitDialog = new ExitDialog(Manager);
                mExitDialog.Init();
                mExitDialog.Closed += new WindowClosedEventHandler(closeDialog_Closed);
                mExitDialog.ShowModal();
                Manager.Add(mExitDialog);
            }
            else if (!mExitConfirmation)
            {
                Exit();
            }
        }
Esempio n. 3
0
		public virtual void Close() {
			WindowClosingEventArgs ex = new WindowClosingEventArgs();
			OnClosing(ex);
			if (!ex.Cancel) {
				Manager.Input.KeyDown -= Input_KeyDown;
				Manager.Input.GamePadDown -= Input_GamePadDown;
				Manager.ModalWindow = lastModal;
				if (lastModal != null)
					lastModal.Focused = true;
				Hide();
				WindowClosedEventArgs ev = new WindowClosedEventArgs();
				OnClosed(ev);

				if (ev.Dispose) {
					this.Dispose();
				}
			}
		}
Esempio n. 4
0
        public virtual void Close()
        {
            WindowClosingEventArgs ex = new WindowClosingEventArgs();

            OnClosing(ex);
            if (!ex.Cancel)
            {
                Manager.Input.KeyDown     -= Input_KeyDown;
                Manager.Input.GamePadDown -= Input_GamePadDown;
                Manager.ModalWindow        = lastModal;
                if (lastModal != null)
                {
                    lastModal.Focused = true;
                }
                Hide();
                WindowClosedEventArgs ev = new WindowClosedEventArgs();
                OnClosed(ev);

                if (ev.Dispose)
                {
                    this.Dispose();
                }
            }
        }
Esempio n. 5
0
		internal void Window_FormClosing(object sender, FormClosingEventArgs e) {
			bool ret = false;

			WindowClosingEventArgs ex = new WindowClosingEventArgs();
			if (WindowClosing != null) {
				WindowClosing.Invoke(this, ex);
				ret = ex.Cancel;
			}

			e.Cancel = ret;
		}
Esempio n. 6
0
		protected virtual void OnClosing(WindowClosingEventArgs e) {
			if (Closing != null)
				Closing.Invoke(this, e);
		}
Esempio n. 7
0
 private void MainWindow_Closing(object sender, WindowClosingEventArgs e)
 {
     e.Cancel = true;
     Manager_WindowClosing(sender, e);
 }
Esempio n. 8
0
		private void MainWindow_Closing(object sender, WindowClosingEventArgs e) {
			e.Cancel = true;
			Manager_WindowClosing(sender, e);
		}
Esempio n. 9
0
		private void Manager_WindowClosing(object sender, WindowClosingEventArgs e) {
			e.Cancel = !mExit && mExitConfirmation;

			if (!mExit && mExitConfirmation && mExitDialog == null) {
				mExitDialog = new ExitDialog(Manager);
				mExitDialog.Init();
				mExitDialog.Closed += new WindowClosedEventHandler(closeDialog_Closed);
				mExitDialog.ShowModal();
				Manager.Add(mExitDialog);
			} else if (!mExitConfirmation) {
				Exit();
			}
		}