private void ReadRecordings(XmlNode result) { recordings = new List<Recording>(); foreach (XmlNode recording in result.SelectNodes ("recordings/recording")) { if (recording ["id"] != null) { recordings.Add (new Recording ( recording ["id"].InnerText, GetInner (recording ["title"]), ReadArtists (recording), ReadReleaseGroups (recording) )); } } }
private static List<ReleaseGroup> ReadReleaseGroups(XmlNode result) { var list = new List<ReleaseGroup> (); foreach (XmlNode releasegroup in result.SelectNodes ("releasegroups/releasegroup")) { if (releasegroup ["id"] != null) { var secondary_types = new List<string> (); foreach (XmlNode sec_type in releasegroup.SelectNodes ("secondarytypes/secondarytype")) { secondary_types.Add (GetInner (sec_type)); } list.Add (new ReleaseGroup ( releasegroup ["id"].InnerText, GetInner (releasegroup ["title"]), GetInner (releasegroup ["type"]), secondary_types)); } } return list; }
public ReleaseGroup(string id, string title, string type, List<string> secondary_types) { ID = id; Title = title; Type = type; SecondaryTypes = secondary_types; }
private static List<Artist> ReadArtists(XmlNode result) { var list = new List<Artist> (); foreach (XmlNode artist in result.SelectNodes ("artists/artist")) { if (artist ["name"] != null) { list.Add (new Artist (artist ["id"].InnerText, GetInner (artist ["name"]))); } } return list; }
public Recording(string id, string title, List<Artist> artists, List<ReleaseGroup> release_groups) { ID = id; Title = title; Artists = artists; ReleaseGroups = release_groups; }