Пример #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(IfcComplexPropertyClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcComplexPropertyClause.WR21:
                    retVal = Functions.SIZEOF(HasProperties.Where(temp => Object.ReferenceEquals(this, temp))) == 0;
                    break;

                case IfcComplexPropertyClause.WR22:
                    retVal = Functions.IfcUniquePropertyName(HasProperties);
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.PropertyResource.IfcComplexProperty>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcComplexProperty.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }