Exemplo n.º 1
0
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "LayerAssignments") == 0)
         {
             List <IfcPresentationLayerAssignment> repItems = new List <IfcPresentationLayerAssignment>(child.ChildNodes.Count);
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcPresentationLayerAssignment a = mDatabase.ParseXml <IfcPresentationLayerAssignment>(cn as XmlElement);
                 if (a != null)
                 {
                     a.addItem(this);
                 }
             }
         }
         else if (string.Compare(name, "StyledByItem") == 0)
         {
             foreach (XmlNode node in child.ChildNodes)
             {
                 IfcStyledItem styled = mDatabase.ParseXml <IfcStyledItem>(node as XmlElement);
                 if (styled != null)
                 {
                     styled.Item = this;
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     if (xml.HasAttribute("RepresentationIdentifier"))
     {
         RepresentationIdentifier = xml.Attributes["RepresentationIdentifier"].Value;
     }
     if (xml.HasAttribute("RepresentationType"))
     {
         RepresentationType = xml.Attributes["RepresentationType"].Value;
     }
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "ContextOfItems") == 0)
         {
             ContextOfItems = mDatabase.ParseXml <IfcRepresentationContext>(child as XmlElement);
         }
         else if (string.Compare(name, "Items") == 0)
         {
             List <IfcRepresentationItem> repItems = new List <IfcRepresentationItem>(child.ChildNodes.Count);
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcRepresentationItem ri = mDatabase.ParseXml <IfcRepresentationItem>(cn as XmlElement);
                 if (ri != null)
                 {
                     repItems.Add(ri);
                 }
             }
             Items = repItems;
         }
         else if (string.Compare(name, "LayerAssignments") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcPresentationLayerAssignment a = mDatabase.ParseXml <IfcPresentationLayerAssignment>(cn as XmlElement);
                 if (a != null)
                 {
                     a.addItem(this);
                 }
             }
         }
     }
 }