Exemplo n.º 1
0
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     if (xml.HasAttribute("Name"))
     {
         Name = xml.Attributes["Name"].Value;
     }
     if (xml.HasAttribute("Description"))
     {
         Description = xml.Attributes["Description"].Value;
     }
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "AssignedItems") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcLayeredItem i = mDatabase.ParseXml <IfcLayeredItem>(cn as XmlElement);
                 if (i != null)
                 {
                     AssignedItems.Add(i);
                 }
             }
         }
     }
     if (xml.HasAttribute("Identifier"))
     {
         Identifier = xml.Attributes["Identifier"].Value;
     }
 }
Exemplo n.º 2
0
 internal override void parseJObject(JObject obj)
 {
     base.parseJObject(obj);
     Name        = extractString(obj.GetValue("Name", StringComparison.InvariantCultureIgnoreCase));
     Description = extractString(obj.GetValue("Description", StringComparison.InvariantCultureIgnoreCase));
     AssignedItems.AddRange(mDatabase.extractJArray <IfcLayeredItem>(obj.GetValue("AssignedItems", StringComparison.InvariantCultureIgnoreCase) as JArray));
     Identifier = extractString(obj.GetValue("Identifier", StringComparison.InvariantCultureIgnoreCase));
 }
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(Name != null ? Name.ToStepValue() : "$");
            parameters.Add(Description != null ? Description.ToStepValue() : "$");
            parameters.Add(AssignedItems != null ? AssignedItems.ToStepValue() : "$");
            parameters.Add(Identifier != null ? Identifier.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
        /// <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(IfcPresentationLayerWithStyleClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcPresentationLayerWithStyleClause.ApplicableOnlyToItems:
                    retVal = Functions.SIZEOF(AssignedItems.Where(temp => (Functions.SIZEOF(Functions.TYPEOF(temp) * Functions.NewTypesArray("IFC4.IFCGEOMETRICREPRESENTATIONITEM", "IFC4.IFCMAPPEDITEM")) == 1))) == Functions.SIZEOF(AssignedItems);
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.PresentationOrganizationResource.IfcPresentationLayerWithStyle>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcPresentationLayerWithStyle.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }