Example #1
0
        }         // GetXmlIntValue(reader)

        /// <summary>
        /// Get xml float value, will return 0 if it does not exists or
        /// isn't a float. Will use the "value" attribute.
        /// </summary>
        /// <param name="reader">Reader</param>
        /// <returns>Float</returns>
        public static float GetXmlFloatValue(XmlReader reader)
        {
            string str = reader.GetAttribute("value");

            float ret = 0;

            //float.TryParse(str, out ret);
            if (CStringHelper.IsNumericFloat(str))
            {
                ret = Convert.ToSingle(str, NumberFormatInfo.InvariantInfo);
            }

            return(ret);
        }         // GetXmlFloatValue(reader)