Esempio n. 1
0
        internal override void parseJObject(JObject obj)
        {
            base.parseJObject(obj);
            JObject jobj = obj.GetValue("RelatingContext", StringComparison.InvariantCultureIgnoreCase) as JObject;

            if (jobj != null)
            {
                RelatingContext = mDatabase.ParseJObject <IfcContext>(jobj);
            }
            RelatedDefinitions.AddRange(mDatabase.extractJArray <IfcDefinitionSelect>(obj.GetValue("RelatedDefinitions", StringComparison.InvariantCultureIgnoreCase) as JArray));
        }
Esempio n. 2
0
        /// <summary>
        /// Tests the express where-clause specified in param 'clause'
        /// </summary>
        /// <param name="clause">The express clause to test</param>
        /// <returns>true if the clause is satisfied.</returns>
        public bool ValidateClause(IfcRelDeclaresClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcRelDeclaresClause.NoSelfReference:
                    retVal = Functions.SIZEOF(RelatedDefinitions.Where(Temp => Object.ReferenceEquals(RelatingContext, Temp))) == 0;
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.Kernel.IfcRelDeclares>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcRelDeclares.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }
Esempio n. 3
0
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "RelatedDefinitions") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcDefinitionSelect d = mDatabase.ParseXml <IfcDefinitionSelect>(cn as XmlElement);
                 if (d != null)
                 {
                     RelatedDefinitions.Add(d);
                 }
             }
         }
         else if (string.Compare(name, "RelatingContext") == 0)
         {
             RelatingContext = mDatabase.ParseXml <IfcContext>(child as XmlElement);
         }
     }
 }