Esempio n. 1
0
        /// <summary>
        /// Get an attribute as double from the top of cascade only
        /// </summary>
        public double GetDoubleFromTop(string name, double defaultValue)
        {
            double retVal = defaultValue;

            var strVal = GetPropertyFromTop(name);

            if (!string.IsNullOrEmpty(strVal))
            {
                retVal = DoubleWithUnitParser.Parse(strVal);
            }

            return(retVal);
        }
Esempio n. 2
0
        /// <summary>
        /// Converts the specified attribute to a double value
        /// </summary>
        private double GetDoubleAttribute(XElement element, string name, double defaultValue)
        {
            double     retVal = defaultValue;
            XAttribute xAttr  = element.Attribute(name);

            if (xAttr != null)
            {
                var dblStr = xAttr.Value;
                retVal = DoubleWithUnitParser.Parse(dblStr);
            }

            return(retVal);
        }