示例#1
0
        /// <summary>
        /// Converts map element into a float or returns default value if conversion is not possible.
        /// </summary>
        /// <param name="key">a key of element to get.</param>
        /// <param name="defaultValue">the default value</param>
        /// <returns>float value of the element or default value if conversion is not supported.</returns>
        /// See <see cref="FloatConverter.ToFloatWithDefault(object, float)"/>
        public float GetAsFloatWithDefault(string key, float defaultValue)
        {
            var value = Get(key);

            return(FloatConverter.ToFloatWithDefault(value, defaultValue));
        }
示例#2
0
 /// <summary>
 /// Converts array element into a float or returns default value if conversion is not possible.
 /// </summary>
 /// <param name="index">an index of element to get.</param>
 /// <param name="defaultValue">the default value</param>
 /// <returns>float value of element or default value if conversion is not supported.</returns>
 /// See <see cref="FloatConverter.ToFloatWithDefault(object, float)"/>
 public float GetAsFloatWithDefault(int index, float defaultValue)
 {
     return(FloatConverter.ToFloatWithDefault(this[index], defaultValue));
 }
示例#3
0
 public float GetAsFloatWithDefault(float defaultValue)
 {
     return(FloatConverter.ToFloatWithDefault(Value, defaultValue));
 }