Apache.NMS.Util.PrimitiveMapInterceptor.GetFloat C# (CSharp) Method

GetFloat() public method

public GetFloat ( string key ) : float
key string
return float
        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);
            }
        }