private void MainWindow1_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == Key.Escape && fullscreen == true) { WindowState = System.Windows.WindowState.Normal; WindowStyle = System.Windows.WindowStyle.SingleBorderWindow; fullscreen = false; } if (e.Key == Key.Space) { if (IsPlaying == false) { MElem.Play(); IsPlaying = true; } else { MElem.Pause(); IsPlaying = false; } } if (e.Key == Key.Left || e.Key == Key.B) { Btn_Prev.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Primitives.ButtonBase.ClickEvent)); } if (e.Key == Key.Right || e.Key == Key.N) { Btn_Next.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Primitives.ButtonBase.ClickEvent)); } }
private void Timer_Loop_Tick(object sender, EventArgs e) { if (media.playState == WMPPlayState.wmppsStopped) { if (loopMode == 1) { Btn_Next.PerformClick(); media.Ctlcontrols.play(); } else { string URL = media.URL; media.URL = null; media.URL = URL; } } }