SharpVectors.Dom.Css.CssAbsPrimitiveLengthValue._getFontSize C# (CSharp) Method

_getFontSize() private method

private _getFontSize ( ) : double
return double
        private double _getFontSize()
        {
            CssPrimitiveValue cssPrimValue;
            XmlElement elmToUse;
            if(_propertyName != null && _propertyName.Equals("font-size"))
            {
                elmToUse = _parentElement;
            }
            else
            {
                elmToUse = _element;
            }

            if(elmToUse == null)
            {
                return 10;
            }
            else
            {
                CssStyleDeclaration csd = (CssStyleDeclaration)_ownerDocument.GetComputedStyle(elmToUse, String.Empty);
                cssPrimValue = csd.GetPropertyCssValue("font-size") as CssPrimitiveValue;

                // no default font-size set => use 10px
                if(cssPrimValue == null)
                {
                    return 10;
                }
                else
                {
                    return cssPrimValue.GetFloatValue(CssPrimitiveType.Px);
                }
            }
        }