33 lines
750 B
C#
33 lines
750 B
C#
using System;
|
|
using System.Xml;
|
|
using System.Globalization;
|
|
|
|
namespace oodb.mapping
|
|
{
|
|
public class DoubleMapping : NaiveMapping
|
|
{
|
|
public DoubleMapping(OODB oodb)
|
|
: base(oodb, typeof(double))
|
|
{
|
|
}
|
|
|
|
public override object FromText(string text)
|
|
{
|
|
double iValue = double.Parse(text, CultureInfo.InvariantCulture);
|
|
if (NativeType != typeof(double))
|
|
{
|
|
return Convert.ChangeType(iValue, NativeType);
|
|
}
|
|
return iValue;
|
|
}
|
|
|
|
public override string ToText(object value)
|
|
{
|
|
double iValue = (double)value;
|
|
return iValue.ToString(CultureInfo.InvariantCulture);
|
|
}
|
|
}
|
|
|
|
}
|
|
|