private List<Playlist> BuildListOfDummyPlaylists(int numberOfPlaylists) { List<Playlist> playlists = new List<Playlist>(); for (int p = 0; p < numberOfPlaylists; p++) { Playlist playlist = new Playlist(); playlist.ID = p; playlist.Name = String.Format("Playlist {0}", p); playlist.PlaylistType = "TestPlaylist"; playlists.Add(playlist); } return playlists; }
/*! * * \copydoc MediaSoftwareService::GetPlaylists() */ public List<Playlist> GetPlaylists() { ValidateState(); IITPlaylistCollection playlists = itunesCom.LibrarySource.Playlists; List<Playlist> listOfPlaylists = new List<Playlist>(); foreach (IITPlaylist playlist in playlists) { Playlist pl = new Playlist(); pl.Name = playlist.Name; pl.ID = playlist.playlistID; pl.PlaylistType = playlist.Kind.ToString(); pl.TrackCount = playlist.Tracks.Count; listOfPlaylists.Add(pl); } return listOfPlaylists; }