private Playlist ClonePlaylist(Database db, Playlist pl) { Playlist clonePl = new Playlist(pl.Name); clonePl.Id = pl.Id; IList <Track> pltracks = pl.Tracks; for (int i = 0; i < pltracks.Count; i++) { clonePl.AddTrack(db.LookupTrackById(pltracks[i].Id), pl.GetContainerId(i)); } return(clonePl); }
internal static void FromPlaylistNode(Database db, ContentNode node, out Track track, out int containerId) { track = null; containerId = 0; foreach (ContentNode field in (ContentNode[])node.Value) { switch (field.Name) { case "dmap.itemid": track = db.LookupTrackById((int)field.Value); break; case "dmap.containeritemid": containerId = (int)field.Value; break; default: break; } } }
private Playlist ClonePlaylist(Database db, Playlist pl) { Playlist clonePl = new Playlist (pl.Name); clonePl.Id = pl.Id; IList<Track> pltracks = pl.Tracks; for (int i = 0; i < pltracks.Count; i++) { clonePl.AddTrack (db.LookupTrackById (pltracks[i].Id), pl.GetContainerId (i)); } return clonePl; }
internal static void FromPlaylistNode(Database db, ContentNode node, out Track track, out int containerId) { track = null; containerId = 0; foreach (ContentNode field in (ContentNode[]) node.Value) { switch (field.Name) { case "dmap.itemid": track = db.LookupTrackById ((int) field.Value); break; case "dmap.containeritemid": containerId = (int) field.Value; break; default: break; } } }