/// <summary> /// The game has advanced to a new flashcard. Get the flashcard's image and display it. /// </summary> void Game_NextFlashcard(object sender, FlashcardEventArgs e) { SoundEffects.Play(Sound.NextFlashcard); Dispatcher.Invoke((Action)(() => { var filename = e.Flashcard.GetFileName(); imgFlashcard.Source = null; var pngStream = GetType().Assembly.GetManifestResourceStream("LightspeedInterface.Images." + filename); PngBitmapDecoder decoder = new PngBitmapDecoder(pngStream, BitmapCreateOptions.None, BitmapCacheOption.Default); BitmapSource bitmapSource = decoder.Frames[0]; imgFlashcard.Source = bitmapSource; })); }
/// <summary> /// The player ran out of time and missed the flashcard. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Game_FlashcardTimeExpired(object sender, FlashcardEventArgs e) { SoundEffects.Play(Sound.ResultTimeout); DispatchUpdateScoreboard(); }