Exemplo n.º 1
0
 /// <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;
     }));
 }
Exemplo n.º 2
0
 /// <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();
 }