예제 #1
0
        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;
            }
        }
예제 #2
0
        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();
                }
            }
        }