/// <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(IfcPileClause clause) { var retVal = false; try { switch (clause) { case IfcPileClause.WR1: retVal = (PredefinedType != IfcPileTypeEnum.USERDEFINED) || ((PredefinedType == IfcPileTypeEnum.USERDEFINED) && Functions.EXISTS(this /* as IfcObject*/.ObjectType)); break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.StructuralElementsDomain.IfcPile>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcPile.{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(IfcPileClause clause) { var retVal = false; try { switch (clause) { case IfcPileClause.CorrectPredefinedType: retVal = !Functions.EXISTS(PredefinedType) || (PredefinedType != IfcPileTypeEnum.USERDEFINED) || ((PredefinedType == IfcPileTypeEnum.USERDEFINED) && Functions.EXISTS(this /* as IfcObject*/.ObjectType)); break; case IfcPileClause.CorrectTypeAssigned: retVal = (Functions.SIZEOF(IsTypedBy) == 0) || (Functions.TYPEOF(this /* as IfcObject*/.IsTypedBy.ItemAt(0).RelatingType).Contains("IFC4.IFCPILETYPE")); break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.StructuralElementsDomain.IfcPile>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcPile.{0}' for #{1}.", clause, EntityLabel), ex); } return(retVal); }