예제 #1
0
 private void PauseButton_Click(object sender, RoutedEventArgs e)
 {
     Player.Pause();
     if (Player.CurrentStatus == MediaStatus.Playing)
     {
         PauseButton.Content = "Pause";
         MediaResume?.Invoke(this, new EventArgs());
     }
     else
     {
         PauseButton.Content = "Resume";
         MediaPause?.Invoke(this, new EventArgs());
     }
 }
예제 #2
0
 private void Player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
 {
     if (e.newState == (int)WMPLib.WMPPlayState.wmppsPlaying)
     {
         MediaResume?.Invoke(this, new EventArgs());
     }
     else if (e.newState == (int)WMPLib.WMPPlayState.wmppsPaused)
     {
         MediaPause?.Invoke(this, new EventArgs());
     }
     else if (e.newState == (int)WMPLib.WMPPlayState.wmppsStopped)
     {
         MediaStop?.Invoke(this, new EventArgs());
     }
 }
예제 #3
0
 public void OnMediaPause() => MediaPause?.Invoke();