示例#1
0
 public bool addReviewer(Review r)
 {
     try
     {
         reviews.Add(r);
     }
     catch
     {
         return false;
     }
     return true;
 }
示例#2
0
 public void removeReview(Review reviewHighlight)
 {
     this.reviews.Remove(reviewHighlight);
 }
示例#3
0
 public void addReview(Review r)
 {
     reviews.Add(r);
 }
示例#4
0
        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;
        }