Exemplo n.º 1
0
 protected virtual void OnClosing(WindowClosingEventArgs e)
 {
     if (Closing != null)
     {
         Closing.Invoke(this, e);
     }
 }
Exemplo 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();
            }
        }
Exemplo 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();
				}
			}
		}
Exemplo 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();
                }
            }
        }
Exemplo 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;
		}
Exemplo n.º 6
0
		protected virtual void OnClosing(WindowClosingEventArgs e) {
			if (Closing != null)
				Closing.Invoke(this, e);
		}
Exemplo n.º 7
0
 private void MainWindow_Closing(object sender, WindowClosingEventArgs e)
 {
     e.Cancel = true;
     Manager_WindowClosing(sender, e);
 }
Exemplo n.º 8
0
		private void MainWindow_Closing(object sender, WindowClosingEventArgs e) {
			e.Cancel = true;
			Manager_WindowClosing(sender, e);
		}
Exemplo 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();
			}
		}