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(IfcReinforcingBarClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcReinforcingBarClause.WR1:
                    retVal = (BarRole != IfcReinforcingBarRoleEnum.USERDEFINED) || ((BarRole == IfcReinforcingBarRoleEnum.USERDEFINED) && Functions.EXISTS(this /* as IfcObject*/.ObjectType));
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.StructuralElementsDomain.IfcReinforcingBar>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcReinforcingBar.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }
        /// <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(IfcReinforcingBarClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcReinforcingBarClause.CorrectPredefinedType:
                    retVal = !Functions.EXISTS(PredefinedType) || (PredefinedType != IfcReinforcingBarTypeEnum.USERDEFINED) || ((PredefinedType == IfcReinforcingBarTypeEnum.USERDEFINED) && Functions.EXISTS(this /* as IfcObject*/.ObjectType));
                    break;

                case IfcReinforcingBarClause.CorrectTypeAssigned:
                    retVal = (Functions.SIZEOF(IsTypedBy) == 0) || (Functions.TYPEOF(this /* as IfcObject*/.IsTypedBy.ItemAt(0).RelatingType).Contains("IFC4.IFCREINFORCINGBARTYPE"));
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.StructuralElementsDomain.IfcReinforcingBar>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcReinforcingBar.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }