public bool addAlbum(Album a) { try { albums.Add(a); } catch { return false; } return true; }
public void removeAlbum(Album albumHighlight) { albums.Remove(albumHighlight); }
private Album albumParser(XmlNodeReader reader) { string name = reader.GetAttribute("name"); Album a = new Album(name); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (reader.Name == "song") { Song s = new Song(); reader.Read(); reader.Read(); s.setName(reader.Value); reader.Read(); reader.Read(); reader.Read(); s.setLength(reader.Value); a.addSong(s); } if (reader.Name == "reviewer") { Review r = new Review(reader.GetAttribute("ref")); reader.Read(); r.setReview(reader.Value); a.addReview(r); } } else if (reader.NodeType == XmlNodeType.EndElement) if (reader.Name == "album") break; } return a; }