////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        protected virtual void OnClosing(WindowClosingEventArgs e)
        {
            if (Closing != null)
            {
                Closing.Invoke(this, e);
            }
        }
Beispiel #2
0
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        private void Manager_WindowClosing(object sender, WindowClosingEventArgs e)
        {
            e.Cancel = !exit && exitConfirmation;

            if (!exit && exitConfirmation && exitDialog == null)
            {
                exitDialog = new ExitDialog(Manager);
                exitDialog.Init();
                exitDialog.Closed += new WindowClosedEventHandler(closeDialog_Closed);
                exitDialog.ShowModal();
                Manager.Add(exitDialog);
            }
            else if (!exitConfirmation)
            {
                Exit();
            }
        }
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        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();
                }
            }
        }
Beispiel #4
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;
        }
		////////////////////////////////////////////////////////////////////////////      

		////////////////////////////////////////////////////////////////////////////	    
		private void MainWindow_Closing(object sender, WindowClosingEventArgs e)
		{
			e.Cancel = true;
			Manager_WindowClosing(sender, e);
		}
		////////////////////////////////////////////////////////////////////////////	  

		////////////////////////////////////////////////////////////////////////////
		private void Manager_WindowClosing(object sender, WindowClosingEventArgs e)
		{
			e.Cancel = !exit && exitConfirmation;

			if (!exit && exitConfirmation && exitDialog == null)
			{
				exitDialog = new ExitDialog(Manager);
				exitDialog.Init();
				exitDialog.Closed += new WindowClosedEventHandler(closeDialog_Closed);
				exitDialog.ShowModal();
				Manager.Add(exitDialog);
			}
			else if (!exitConfirmation)
			{
				Exit();
			}
		}
 ////////////////////////////////////////////////////////////////////////////    
 ////////////////////////////////////////////////////////////////////////////    
 protected virtual void OnClosing(WindowClosingEventArgs e)
 {
     if (Closing != null) Closing.Invoke(this, e);
 }
        ////////////////////////////////////////////////////////////////////////////  
        ////////////////////////////////////////////////////////////////////////////
        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();
            }
              }
        }
Beispiel #9
0
        private void LogicWindowClosed(WindowClosingEventArgs args)
        {
            if (args != null) args.Cancel = true;
            _logicWindow.Hide();

            // Update the logic within the currently selected node
            _logicWindow.GetInstance(GetCurrentlySelectedNode());

            EnableWorld(true);
        }
Beispiel #10
0
 ////////////////////////////////////////////////////////////////////////////      
 ////////////////////////////////////////////////////////////////////////////      
 void WindowClosing(object sender, WindowClosingEventArgs e)
 {
     //e.Cancel = true;
 }
Beispiel #11
0
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        private void MainWindow_Closing(object sender, WindowClosingEventArgs e)
        {
            e.Cancel = true;
            Manager_WindowClosing(sender, e);
        }
Beispiel #12
0
        /// <summary>
        /// Windows form closing event handler when running on windows.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        internal void Window_FormClosing(object sender, FormClosingEventArgs e)
        {
            bool ret = false;

            // Fire the window closing event.
            WindowClosingEventArgs ex = new WindowClosingEventArgs();
            if (WindowClosing != null)
            {
                WindowClosing.Invoke(this, ex);
                ret = ex.Cancel;
            }

            // Cancel closing if necessary.
            e.Cancel = ret;
        }
Beispiel #13
0
 /// <summary>
 /// Handles the main window's closing event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MainWindow_Closing(object sender, WindowClosingEventArgs e)
 {
     // Let the GUI manager handle it.
     e.Cancel = true;
     Manager_WindowClosing(sender, e);
 }
 void WindowCloseBehavior(object sender, WindowClosingEventArgs e)
 {
     StateSystem stateSys = (StateSystem)world.SystemManager.GetSystem<StateSystem>()[0];
     stateSys.SetCanvasCanBeReached(true);
 }
Beispiel #15
0
 void WindowCloseBehavior(object sender, WindowClosingEventArgs e)
 {
     canvasCanBeReached = true;
 }
Beispiel #16
0
 private void TowerInfoWindow_Closing(object sender, WindowClosingEventArgs e)
 {
     if (GamePlayScreen.TowerManager.SelectedTower == Tower)
         GamePlayScreen.TowerManager.DeselectTower();
 }