addRelated() приватный Метод

private addRelated ( IfcResourceObjectSelect r ) : void
r IfcResourceObjectSelect
Результат void
Пример #1
0
 //internal List<IfcExternalReferenceRelationship> mHasExternalReferences = new List<IfcExternalReferenceRelationship>(); //IFC4
 //internal List<IfcResourceConstraintRelationship> mHasConstraintRelationships = new List<IfcResourceConstraintRelationship>(); //gg
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "HasExternalReferences") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
         else if (string.Compare(name, "HasConstraintRelationships") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
     }
 }
Пример #2
0
 {                                                                                                                                //,IfcExternallyDefinedSurfaceStyle ,IfcExternallyDefinedSymbol ,IfcExternallyDefinedTextFont ,IfcLibraryReference));
     internal override void ParseXml(XmlElement xml)
     {
         base.ParseXml(xml);
         if (xml.HasAttribute("Location"))
         {
             Location = xml.Attributes["Location"].Value;
         }
         if (xml.HasAttribute("Identification"))
         {
             Identification = xml.Attributes["Identification"].Value;
         }
         if (xml.HasAttribute("Name"))
         {
             Name = xml.Attributes["Name"].Value;
         }
         foreach (XmlNode child in xml.ChildNodes)
         {
             string name = child.Name;
             if (string.Compare(name, "HasExternalReferences") == 0)
             {
                 List <IfcExternalReferenceRelationship> references = new List <IfcExternalReferenceRelationship>(child.ChildNodes.Count);
                 foreach (XmlNode cn in child.ChildNodes)
                 {
                     IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                     if (r != null)
                     {
                         references.Add(r);
                     }
                 }
                 mHasExternalReferences = references;
             }
             else if (string.Compare(name, "HasConstraintRelationships") == 0)
             {
                 foreach (XmlNode cn in child.ChildNodes)
                 {
                     IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                     if (r != null)
                     {
                         r.addRelated(this);
                     }
                 }
             }
             else if (string.Compare(name, "ExternalReferenceForResources") == 0)
             {
                 foreach (XmlNode cn in child.ChildNodes)
                 {
                     IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                     if (r != null)
                     {
                         r.addRelated(this);
                     }
                 }
             }
         }
     }
Пример #3
0
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     if (xml.HasAttribute("Name"))
     {
         Name = xml.Attributes["Name"].Value;
     }
     if (xml.HasAttribute("Description"))
     {
         Description = xml.Attributes["Description"].Value;
     }
     if (xml.HasAttribute("ConstraintGrade"))
     {
         Enum.TryParse <IfcConstraintEnum>(xml.Attributes["ConstraintGrade"].Value, true, out mConstraintGrade);
     }
     if (xml.HasAttribute("ConstraintSource"))
     {
         ConstraintSource = xml.Attributes["ConstraintSource"].Value;
     }
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "CreatingActor") == 0)
         {
             CreatingActor = mDatabase.ParseXml <IfcActorSelect>(child as XmlElement);
         }
         else if (string.Compare(name, "HasExternalReferences") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
         else if (string.Compare(name, "PropertiesForConstraint") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.RelatingConstraint = this;
                 }
             }
         }
         else if (string.Compare(name, "HasConstraintRelationships") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
     }
     if (xml.HasAttribute("UserDefinedGrade"))
     {
         UserDefinedGrade = xml.Attributes["UserDefinedGrade"].Value;
     }
 }
Пример #4
0
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     if (xml.HasAttribute("Name"))
     {
         Name = xml.Attributes["Name"].Value;
     }
     if (xml.HasAttribute("Description"))
     {
         Description = xml.Attributes["Description"].Value;
     }
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "AppliedValue") == 0)
         {
             AppliedValue = mDatabase.ParseXml <IfcAppliedValueSelect>(child as XmlElement);
             if (mAppliedValueIndex == 0)
             {
                 mAppliedValueValue = extractValue(child.FirstChild);
             }
         }
         else if (string.Compare(name, "UnitBasis") == 0)
         {
             UnitBasis = mDatabase.ParseXml <IfcMeasureWithUnit>(child as XmlElement);
         }
         else if (string.Compare(name, "Components") == 0)
         {
             foreach (XmlNode node in child.ChildNodes)
             {
                 IfcAppliedValue v = mDatabase.ParseXml <IfcAppliedValue>(node as XmlElement);
                 if (v != null)
                 {
                     addComponent(v);
                 }
             }
         }
         else if (string.Compare(name, "HasExternalReferences") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
         else if (string.Compare(name, "HasConstraintRelationships") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
     }
     //todo
     if (xml.HasAttribute("Category"))
     {
         Category = xml.Attributes["Category"].Value;
     }
     if (xml.HasAttribute("Condition"))
     {
         Condition = xml.Attributes["Condition"].Value;
     }
     if (xml.HasAttribute("ArithmeticOperator"))
     {
         Enum.TryParse <IfcArithmeticOperatorEnum>(xml.Attributes["ArithmeticOperator"].Value, true, out mArithmeticOperator);
     }
 }