コード例 #1
0
 protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed)
 {
     base.setJSON(obj, host, processed);
     if (mTemplateType != IfcPropertySetTemplateTypeEnum.NOTDEFINED)
     {
         obj["TemplateType"] = mTemplateType.ToString();
     }
     setAttribute(obj, "ApplicableEntity", ApplicableEntity);
     obj["HasPropertyTemplates"] = new JArray(HasPropertyTemplates.ToList().ConvertAll(x => x.getJson(this, processed)));
 }
コード例 #2
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(GlobalId != null ? GlobalId.ToStepValue() : "$");
            parameters.Add(OwnerHistory != null ? OwnerHistory.ToStepValue() : "$");
            parameters.Add(Name != null ? Name.ToStepValue() : "$");
            parameters.Add(Description != null ? Description.ToStepValue() : "$");
            parameters.Add(TemplateType.ToStepValue());
            parameters.Add(ApplicableEntity != null ? ApplicableEntity.ToStepValue() : "$");
            parameters.Add(HasPropertyTemplates != null ? HasPropertyTemplates.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
コード例 #3
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(IfcComplexPropertyTemplateClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcComplexPropertyTemplateClause.UniquePropertyNames:
                    retVal = Functions.IfcUniquePropertyTemplateNames(HasPropertyTemplates);
                    break;

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