public void AttemptClose(object sender, System.ComponentModel.CancelEventArgs e) { Action action = new Action(() => { MainThread.Close(); }); if (Properties.LauncherSettings.Default.KeepLauncherOpen && LauncherModel.Default.GameManager.GameProcess != null) { if (!AllowedToCloseWithGameOpen) { e.Cancel = true; ShowPrompt_ClosingWithGameStillOpened(action); } } else { e.Cancel = false; } }