internal static IfcValue parseValue(string str) { IfcMeasureValue mv = parseMeasureValue(str); if (mv != null) { return(mv); } IfcSimpleValue sv = parseSimpleValue(str); if (sv != null) { return(sv); } return(parseDerivedMeasureValue(str)); }
internal static IfcValue parseValue(string str) { if (string.Compare(str, "$", true) == 0) { return(null); } IfcMeasureValue mv = parseMeasureValue(str); if (mv != null) { return(mv); } IfcSimpleValue sv = parseSimpleValue(str); if (sv != null) { return(sv); } return(parseDerivedMeasureValue(str)); }
/// <summary> /// Extension method to create hash of the IfcSimpleValue /// </summary> /// <param name="value"></param> /// <returns></returns> public static int CreateHash(this IfcSimpleValue value) { if (value == null) { throw new ArgumentNullException(); } //hash of the type var typeName = value.GetType().Name; var typeHash = typeName.GetHashCode(); //switch(typeName) //{ // case "IfcInteger": // typeHash = // break; // case "IfcReal": // break; // case "IfcBoolean": // break; // case "IfcIdentifier": // break; // case "IfcText": // break; // case "IfcLabel": // break; // case "IfcLogical": // break; // default: // break; //} //hash of the actual value var valHash = value.ToString().GetHashCode(); return(valHash + typeHash); }
public AttributeHasedRoot(IfcRoot root, IfcSimpleValue value) { _root = root; _val = value; _hash = value.ToString().GetHashCode(); }