public bool addSong(Song s) { try { songs.Add(s); } catch { return false; } return true; }
public void removeSong(Song songHighlight) { this.songs.Remove(songHighlight); }
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; }