Пример #1
0
        private void PlayerStateChanged(object sender, PlayerStateEventArgs e)
        {
            switch (e.NewState)
            {
            case PlayerState.Closed:
                Taskbar.SetProgressState(TaskbarProgressBarState.NoProgress);
                m_UpdateTimer.Stop();
                s_PlayPauseButton.Icon    = s_PlayIcon;
                s_PlayPauseButton.Tooltip = TEXT_PLAY;
                Taskbar.SetOverlayIcon(m_MpdnFormHandle, null, "");
                break;

            case PlayerState.Stopped:
                Taskbar.SetProgressState(TaskbarProgressBarState.NoProgress);
                m_UpdateTimer.Start();
                s_PlayPauseButton.Icon    = s_PlayIcon;
                s_PlayPauseButton.Tooltip = TEXT_PLAY;
                Taskbar.SetOverlayIcon(m_MpdnFormHandle, null, "");
                break;

            case PlayerState.Playing:
                Taskbar.SetProgressState(TaskbarProgressBarState.Normal);
                m_UpdateTimer.Start();
                s_PlayPauseButton.Icon    = s_PauseIcon;
                s_PlayPauseButton.Tooltip = TEXT_PAUSE;
                Taskbar.SetOverlayIcon(m_MpdnFormHandle, s_PlayOverlayIcon, "Playing");
                break;

            case PlayerState.Paused:
                Taskbar.SetProgressState(TaskbarProgressBarState.Paused);
                m_UpdateTimer.Start();
                s_PlayPauseButton.Icon    = s_PlayIcon;
                s_PlayPauseButton.Tooltip = TEXT_PLAY;
                Taskbar.SetOverlayIcon(m_MpdnFormHandle, s_PauseOverlayIcon, "Paused");
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #2
0
 void CreateOverlay()
 {
     Taskbar.SetOverlayIcon(m_host.MainWindow.Handle, Properties.Resources.bird.Handle, PLEASANT_PASSWORD_SERVER);
     Taskbar.SetValue(m_host.MainWindow.Handle, 100, 100);
     Taskbar.SetState(m_host.MainWindow.Handle, Taskbar.TaskbarStates.Error);
 }