internal static IfcMeasureValue extractMeasureValue(Type type, string value)
{
if (type.GetInterfaces().Contains(typeof(IfcMeasureValue)))
{
if (string.Compare(type.Name,"IfcDescriptiveMeasure",true) == 0)
return new IfcDescriptiveMeasure(value);
double val = 0;
if(double.TryParse(value,out val))
{
Type[] types = new Type[] { typeof(double) };
ConstructorInfo constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
null, types, null);
if (constructor != null)
return constructor.Invoke(new object[] { val }) as IfcMeasureValue;
}
}
return null;
}