//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// protected virtual void OnClosing(WindowClosingEventArgs e) { if (Closing != null) { Closing.Invoke(this, 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(); } }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// 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(); } } }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// 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(); } } }
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); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// void WindowClosing(object sender, WindowClosingEventArgs e) { //e.Cancel = true; }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// private void MainWindow_Closing(object sender, WindowClosingEventArgs e) { e.Cancel = true; Manager_WindowClosing(sender, e); }
/// <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; }
/// <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); }
void WindowCloseBehavior(object sender, WindowClosingEventArgs e) { canvasCanBeReached = true; }
private void TowerInfoWindow_Closing(object sender, WindowClosingEventArgs e) { if (GamePlayScreen.TowerManager.SelectedTower == Tower) GamePlayScreen.TowerManager.DeselectTower(); }