public override void IfcParse(int propIndex, IPropertyValue value) { switch (propIndex) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: base.IfcParse(propIndex, value); break; case 7: _benchmark = (IfcBenchmarkEnum)Enum.Parse(typeof(IfcBenchmarkEnum), value.EnumVal); break; case 8: _valueSource = value.StringVal; break; case 9: _dataValue = (IfcMetricValueSelect)value.EntityVal; break; default: this.HandleUnexpectedAttribute(propIndex, value); break; } }
public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex) { switch (propIndex) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: base.Parse(propIndex, value, nestedIndex); return; case 7: _benchmark = (IfcBenchmarkEnum)System.Enum.Parse(typeof(IfcBenchmarkEnum), value.EnumVal, true); return; case 8: _valueSource = value.StringVal; return; case 9: _dataValue = (IfcMetricValueSelect)(value.EntityVal); return; case 10: _referencePath = (IfcReference)(value.EntityVal); return; default: throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper())); } }
public IfcMetric(IfcLabel __Name, IfcText?__Description, IfcConstraintEnum __ConstraintGrade, IfcLabel?__ConstraintSource, IfcActorSelect __CreatingActor, IfcDateTimeSelect __CreationTime, IfcLabel?__UserDefinedGrade, IfcBenchmarkEnum __Benchmark, IfcLabel?__ValueSource, IfcMetricValueSelect __DataValue) : base(__Name, __Description, __ConstraintGrade, __ConstraintSource, __CreatingActor, __CreationTime, __UserDefinedGrade) { this._Benchmark = __Benchmark; this._ValueSource = __ValueSource; this._DataValue = __DataValue; }
internal override void ParseXml(XmlElement xml) { base.ParseXml(xml); if (xml.HasAttribute("BenchMark")) { Enum.TryParse <IfcBenchmarkEnum>(xml.Attributes["BenchMark"].Value, true, out mBenchMark); } if (xml.HasAttribute("ValueSource")) { ValueSource = xml.Attributes["ValueSource"].Value; } foreach (XmlNode child in xml.ChildNodes) { string name = child.Name; if (string.Compare(name, "DataValue") == 0) { if (child.HasChildNodes) { mDataValueValue = extractValue(child.FirstChild); } if (mDataValueValue == null) { BaseClassIfc baseClass = mDatabase.ParseXml <BaseClassIfc>(child as XmlElement); IfcMetricValueSelect metric = baseClass as IfcMetricValueSelect; if (metric != null) { DataValue = metric; } else { mDataValueValue = extractValue(child as XmlNode); } } } else if (string.Compare(name, "ReferencePath") == 0) { ReferencePath = mDatabase.ParseXml <IfcReference>(child as XmlElement); } } }
internal override void parseJObject(JObject obj) { base.parseJObject(obj); JToken token = obj.GetValue("BenchMark", StringComparison.InvariantCultureIgnoreCase); if (token != null) { Enum.TryParse <IfcBenchmarkEnum>(token.Value <string>(), out mBenchMark); } token = obj.GetValue("ValueSource", StringComparison.InvariantCultureIgnoreCase); if (token != null) { ValueSource = token.Value <string>(); } token = obj.GetValue("DataValue", StringComparison.InvariantCultureIgnoreCase); if (token != null) { JObject jobj = token as JObject; if (jobj != null) { BaseClassIfc bc = mDatabase.ParseJObject <BaseClassIfc>(jobj); IfcMetricValueSelect value = bc as IfcMetricValueSelect; if (value != null) { DataValue = value; } else { mDataValueValue = DatabaseIfc.ParseValue(jobj); } } //else } JObject jo = obj.GetValue("ReferencePath", StringComparison.InvariantCultureIgnoreCase) as JObject; if (jo != null) { ReferencePath = mDatabase.ParseJObject <IfcReference>(jo); } }
public override void IfcParse(int propIndex, IPropertyValue value) { switch (propIndex) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: base.IfcParse(propIndex, value); break; case 7: _benchmark = (IfcBenchmarkEnum) Enum.Parse(typeof (IfcBenchmarkEnum), value.EnumVal); break; case 8: _valueSource = value.StringVal; break; case 9: _dataValue = (IfcMetricValueSelect) value.EntityVal; break; default: this.HandleUnexpectedAttribute(propIndex, value); break; } }
public IfcMetric(DatabaseIfc db, string name, IfcConstraintEnum constraint, IfcMetricValueSelect dataValue) : base(db, name, constraint) { DataValue = dataValue; }