protected override void OnFormClosing(FormClosingEventArgs e) { if ((e.CloseReason == CloseReason.UserClosing) && this.IsPhotonRunningAsApp()) { string str; if (MessageBox.Show(Program.ResourceManager.GetString("launcherPhotonStopWarningMsg"), Program.ResourceManager.GetString("launcherPhotonStoppingText"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { e.Cancel = true; return; } PhotonHandler.StopPhotonApplication("Simple", this.photonWorkingDirectory, out str); if (!string.IsNullOrEmpty(str)) { MessageBox.Show(str); } } Application.Exit(); }
private void StopPhoton() { string str; if (!this.IsPhotonRunningAsApp()) { str = Program.ResourceManager.GetString("launcherPhotonNotRunningText"); } else { this.startStopButton.Text = Program.ResourceManager.GetString("launcherWaitButtonText"); PhotonHandler.StopPhotonApplication("Simple", this.photonWorkingDirectory, out str); } if (!string.IsNullOrEmpty(str)) { MessageBox.Show(str); this.SetEnabledMenuItems(); } }