private void GetAlbumInfo_Click(object sender, EventArgs e) { if (!lastfm.Session.Authenticated) { LastFmLogin(); } if (lastfm.Session.Authenticated) { AudioFile selectedSong = activePL.Songs.ElementAt(listBox1.SelectedIndex); string content; try { content = lastfm.GetAlbumInfo(selectedSong.Artist, selectedSong.AlbumTitle); } catch (IndexOutOfRangeException) { content = "Could not find album. Either it does not exist or files tags are incorrect"; } catch (WebException) { content = "Either internet connection is not found or could not find album because file does not have required tags"; } LastFmInfo info = new LastFmInfo(content); info.Show(); } }
private void GetArtistInfo_Click(object sender, EventArgs e) { if (!lastfm.Session.Authenticated) { LastFmLogin(); } if (lastfm.Session.Authenticated) { AudioFile selectedSong = activePL.Songs.ElementAt(listBox1.SelectedIndex); string content = lastfm.GetArtistInfo(selectedSong.Artist); LastFmInfo info = new LastFmInfo(content); info.Show(); } }