public void GetArtistSongTest() { Assert.AreEqual("Enrique Iglesias", SongInfo.GetArtistSong(path)); Assert.AreEqual("Margaret Heartbeat", SongInfo.GetArtistSong(path4)); Assert.AreEqual("Enrique Iglesias", SongInfo.GetArtistsSong(path)); Assert.IsNull(SongInfo.GetArtistSong(path2)); Assert.IsNull(SongInfo.GetArtistsSong(path2)); }
public PlayListModel GetSongInfo(string path) { var song = new PlayListModel(); song.FirstPerformerAndAlbum = SongInfo.GetArtistsSong(path); song.SongPath = path; song.Duration = SongInfo.GetDurationSong(path); song.Title = SongInfo.GetTitleSong(path); song.PlayListIndex = listBoxItems.Count + 1; return(song); }
void playlistLstBox_Drop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); foreach (string file in files) { PlayListModel newSong = new PlayListModel(); newSong.FirstPerformerAndAlbum = SongInfo.GetArtistsSong(file); newSong.SongPath = file; newSong.Duration = SongInfo.GetDurationSong(file); newSong.Title = SongInfo.GetTitleSong(file); newSong.PlayListIndex = PlayListViewModel.ListBoxItems.Count + 1; PlayListViewModel.ListBoxItems.Add(newSong); } }