Exemplo n.º 1
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(IfcRelNestsClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcRelNestsClause.WR1:
                    retVal = Functions.SIZEOF(this /* as IfcRelDecomposes*/.RelatedObjects.Where(Temp => !(Functions.TYPEOF(this /* as IfcRelDecomposes*/.RelatingObject) == Functions.TYPEOF(Temp)))) == 0;
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.Kernel.IfcRelNests>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcRelNests.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }
Exemplo 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(IfcRelNestsClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcRelNestsClause.NoSelfReference:
                    retVal = Functions.SIZEOF(RelatedObjects.Where(Temp => Object.ReferenceEquals(RelatingObject, Temp))) == 0;
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.Kernel.IfcRelNests>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcRelNests.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }