public float GetFloat(string key)
{
Object value = GetObjectProperty(key);
try
{
if(value is Single)
{
return (float) value;
}
else if(value is String)
{
return Convert.ToSingle(value);
}
else
{
throw new MessageFormatException(" cannot read a float from " + value.GetType().Name);
}
}
catch(FormatException ex)
{
throw NMSExceptionSupport.CreateMessageFormatException(ex);
}
}