示例#1
0
        internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary <int, XmlElement> processed)
        {
            base.SetXML(xml, host, processed);

            if (mPredefinedType != IfcAnalysisModelTypeEnum.NOTDEFINED)
            {
                xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower());
            }
            if (mOrientationOf2DPlane > 0)
            {
                xml.AppendChild(mDatabase[mOrientationOf2DPlane].GetXML(xml.OwnerDocument, "OrientationOf2DPlane", this, processed));
            }
            if (mLoadedBy.Count > 0)
            {
                XmlElement element = xml.OwnerDocument.CreateElement("LoadedBy");
                xml.AppendChild(element);
                foreach (int item in mLoadedBy)
                {
                    element.AppendChild(mDatabase[item].GetXML(xml.OwnerDocument, "", this, processed));
                }
            }
            if (mHasResults.Count > 0)
            {
                XmlElement element = xml.OwnerDocument.CreateElement("HasResults");
                xml.AppendChild(element);
                foreach (int item in mHasResults)
                {
                    element.AppendChild(mDatabase[item].GetXML(xml.OwnerDocument, "", this, processed));
                }
            }
            if (mSharedPlacement != null)
            {
                xml.AppendChild(SharedPlacement.GetXML(xml.OwnerDocument, "SharedPlacement", this, processed));
            }
        }
示例#2
0
 protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed)
 {
     base.setJSON(obj, host, processed);
     if (mPredefinedType != IfcAnalysisModelTypeEnum.NOTDEFINED)
     {
         obj["PredefinedType"] = mPredefinedType.ToString();
     }
     if (mOrientationOf2DPlane > 0)
     {
         obj["OrientationOf2DPlane"] = OrientationOf2DPlane.getJson(this, processed);
     }
     if (mLoadedBy.Count > 0)
     {
         obj["LoadedBy"] = new JArray(mLoadedBy.ConvertAll(x => mDatabase[x].getJson(this, processed)));
     }
     if (mHasResults.Count > 0)
     {
         obj["HasResults"] = new JArray(mHasResults.ConvertAll(x => mDatabase[x].getJson(this, processed)));
     }
     if (mSharedPlacement > 0)
     {
         obj["SharedPlacement"] = SharedPlacement.getJson(this, processed);
     }
 }