private void OnExit(object sender, EventArgs e) { string msg = "Are you sure you want to exit?"; if ((SmartVolManagerPackage.BgMusicManager.MusicState == SmartVolManagerPackage.BgMusicState.Play) || (SmartVolManagerPackage.BgMusicManager.AutoMuted == true)) { msg = msg + " " + "Your music will be stopped."; } MessageBoxEx msgBoxEx = new MessageBoxEx(msg, UiCommands.mPlayerForm.WindowState == FormWindowState.Minimized ? "" : "Minimize"); msgBoxEx.ShowDialog(); switch (msgBoxEx.ButtonPressedIndex) { case 0: UiCommands.Exit(); break; case 1: break; case 2: if (UiCommands.mPlayerForm != null) { UiCommands.mPlayerForm.WindowState = FormWindowState.Minimized; } break; } }
public void Exit(bool showPrompt) { string msg = "Are you sure you want to exit?"; if (showPrompt) { if ((SmartVolManagerPackage.BgMusicManager.MusicState == SmartVolManagerPackage.BgMusicState.Play) || (SmartVolManagerPackage.BgMusicManager.AutoMuted == true)) { msg = msg + " " + "Your music will be stopped."; } MessageBoxEx msgBoxEx = new MessageBoxEx(msg, "Minimize to Tray"); msgBoxEx.ShowDialog(); switch (msgBoxEx.ButtonPressedIndex) { case 0: if (_isStandAlone) { Application.Exit(); } else { UiCommands.Exit(); } break; case 1: break; case 2: UiCommands.HideMixer(); break; } } else { if (_isStandAlone) { Application.Exit(); } else { UiCommands.Exit(); } } }