private void Window_KeyUp(object sender, KeyEventArgs e) { switch (e.Key) { case Key.D0: case Key.D1: case Key.D2: case Key.D3: case Key.D4: case Key.D5: case Key.D6: case Key.D7: case Key.D8: case Key.D9: int fileNumber = ((int)e.Key) - 34; AddWorkToQueue(fileNumber.ToString()); break; case Key.S: // S pressed: stop media playback CoinWarsPlayer.Stop(); CoinWarsPlayer.Close(); break; case Key.P: // P pressed: pause media playback break; case Key.Escape: // close if escape is pressed Application.Current.Shutdown(); break; } }
private void StopPromo() { if (!playingPromo) { return; } CoinWarsPlayer.Stop(); CoinWarsPlayer.Close(); playingPromo = false; }
private void PlayVideo(VideoType type) { Uri file = null; int count = 0; int random = 0; switch (type) { case VideoType.Positive: count = positiveVideos.Count(); if (count <= 0) { break; } random = rand.Next(count); file = positiveVideos[random]; break; case VideoType.Negative: count = negativeVideos.Count(); if (count <= 0) { break; } random = rand.Next(count); file = negativeVideos[random]; break; case VideoType.Promo: count = promoVideos.Count(); if (count <= 0) { break; } random = rand.Next(count); file = promoVideos[random]; break; default: return; } playing = true; CoinWarsPlayer.Stop(); CoinWarsPlayer.Close(); CoinWarsPlayer.Source = file; CoinWarsPlayer.Play(); }