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(); } }
private void closeDialog_Closed(object sender, WindowClosedEventArgs e) { if ((sender as Dialog).ModalResult == EModalResult.Yes) { Exit(); } else { mExit = false; mExitDialog.Closed -= closeDialog_Closed; mExitDialog.Dispose(); mExitDialog = null; if (mMainWindow != null) { mMainWindow.Focused = true; } } }
private void closeDialog_Closed(object sender, WindowClosedEventArgs e) { if ((sender as Dialog).ModalResult == EModalResult.Yes) { Exit(); } else { mExit = false; mExitDialog.Closed -= closeDialog_Closed; mExitDialog.Dispose(); mExitDialog = null; if (mMainWindow != null) mMainWindow.Focused = true; } }
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(); } }