BuildList() static private method

static private BuildList ( XmlReader rdr ) : BatchBook.Location[]
rdr System.Xml.XmlReader
return BatchBook.Location[]
Example #1
0
        internal Person(XmlReader rdr)
        {
            rdr.ReadStartElement("person");
            this.Id        = int.Parse(rdr.ReadElementString("id"));
            this.FirstName = rdr.ReadElementString("first_name");
            this.LastName  = rdr.ReadElementString("last_name");
            //Skipping Image Fields
            rdr.ReadToFollowing("title");
            this.Title   = rdr.ReadElementString("title");
            this.Company = rdr.ReadElementString("company");

            int companyId;

            if (int.TryParse(rdr.ReadElementString("company_id"), out companyId))
            {
                this.CompanyId = companyId;
            }

            this.Tags         = Tag.BuildList(rdr);
            this.Locations    = Location.BuildList(rdr);
            this.MegaComments = MegaComment.BuildList(rdr);
            this.Notes        = rdr.ReadElementString("notes");
            this.CreatedAt    = rdr.ReadElementString("created_at").FromBatchBookFormat();
            this.UpdatedAt    = rdr.ReadElementString("updated_at").FromBatchBookFormat();
            rdr.ReadEndElement();
        }
Example #2
0
 internal Company(XmlReader rdr)
 {
     rdr.ReadStartElement("company");
     this.Id    = rdr.ReadElementContentAsInt("id", "");
     this.Name  = rdr.ReadElementString("name");
     this.Notes = rdr.ReadElementString("notes");
     //Skipping Images
     rdr.ReadToFollowing("tags");
     this.Tags      = Tag.BuildList(rdr);
     this.Locations = Location.BuildList(rdr);
     this.Comments  = MegaComment.BuildList(rdr);
     this.CreatedAt = rdr.ReadElementString("created_at").FromBatchBookFormat();
     this.UpdatedAt = rdr.ReadElementString("updated_at").FromBatchBookFormat();
     rdr.ReadEndElement();
 }