BatchBook.AttachedContact.BuildList C# (CSharp) Method

BuildList() static private method

static private BuildList ( XmlReader rdr ) : BatchBook.AttachedContact[]
rdr System.Xml.XmlReader
return BatchBook.AttachedContact[]
        internal static AttachedContact[] BuildList(XmlReader rdr)
        {
            List<AttachedContact> attachedContacts = new List<AttachedContact>();
            rdr.ReadStartElement("attached_communications");
            while (rdr.ReadToFollowing("attached_communication_id"))
            {
                attachedContacts.Add(new AttachedContact(rdr));
            }
            rdr.ReadEndElement();

            return attachedContacts.ToArray();
        }

Usage Example

Beispiel #1
0
 internal Deal(XmlReader rdr)
 {
     this.Id                     = rdr.ReadElementContentAsInt("id", "");
     this.Title                  = rdr.ReadElementString("title");
     this.Description            = rdr.ReadElementString("description");
     this.DealWith               = rdr.ReadElementString("deal_with");
     this.DealWithId             = int.Parse(rdr.ReadElementString("deal_with_id"));
     this.Status                 = rdr.ReadElementString("status");
     this.AssignedTo             = rdr.ReadElementString("assigned_to");
     this.Amount                 = float.Parse(rdr.ReadElementString("amount"));
     this.AttachedCommunications = AttachedCommunication.BuildList(rdr);
     this.AttachedContacts       = AttachedContact.BuildList(rdr);
     this.AttachedToDos          = AttachedTodo.BuildList(rdr);
     this.Tags                   = Tag.BuildList(rdr);
     this.Comments               = MegaComment.BuildList(rdr);
     this.CreatedAt              = rdr.ReadElementString("created_at").FromBatchBookFormat();
     this.UpdatedAt              = rdr.ReadElementString("updated_at").FromBatchBookFormat();
 }