Exemplo n.º 1
0
        private void SetSongPicture(KnownSongInfo info)
        {
            songPicture.Source = new BitmapImage(new Uri("DefaultAlbum.png", UriKind.Relative));
            Thread pic = new Thread((ThreadStart) delegate
            {
                string uri;
                try
                {
                    uri = info.GetSong().AdditionalInfo.CoverUri64;
                }
                catch (WebException ex)
                {
                    MessageBox.Show(ex.Message, "Web Error!");
                    return;
                }
                catch (NullReferenceException)
                {
                    // No album cover found.
                    return;
                }
                SetPicture(uri);
            });

            pic.Start();
        }
Exemplo n.º 2
0
 private void PlaySong(KnownSongInfo song)
 {
     manager.Stop();
     songNameLabel.Content   = song.Name;
     songArtistLabel.Content = song.Artist;
     _isSongPlaying          = true;
     IsPaused = false;
     manager.Play(song.GetSong().Uri);
     SetSongPicture(song);
 }
Exemplo n.º 3
0
 private void SetSongPicture(KnownSongInfo info)
 {
     songPicture.Source = new BitmapImage(new Uri("DefaultAlbum.png", UriKind.Relative));
     Thread pic = new Thread((ThreadStart) delegate
     {
         string uri;
         try
         {
             uri = info.GetSong().AdditionalInfo.CoverUri64;
         }
         catch (WebException ex)
         {
             MessageBox.Show(ex.Message, "Web Error!");
             return;
         }
         catch (NullReferenceException)
         {
             // No album cover found.
             return;
         }
         SetPicture(uri);
     });
     pic.Start();
 }
Exemplo n.º 4
0
 private void PlaySong(KnownSongInfo song)
 {
     manager.Stop();
     songNameLabel.Content = song.Name;
     songArtistLabel.Content = song.Artist;
     _isSongPlaying = true;
     IsPaused = false;
     manager.Play(song.GetSong().Uri);
     SetSongPicture(song);
 }