System.Xml.XsdValidatingReader.ReadElementContentAsDouble C# (CSharp) Method

ReadElementContentAsDouble() public method

public ReadElementContentAsDouble ( ) : double
return double
        public override double ReadElementContentAsDouble()
        {
            if (this.NodeType != XmlNodeType.Element)
            {
                throw CreateReadElementContentAsException(nameof(ReadElementContentAsDouble));
            }
            XmlSchemaType xmlType;

            object typedValue = InternalReadElementContentAsObject(out xmlType);

            try
            {
                if (xmlType != null)
                {
                    return xmlType.ValueConverter.ToDouble(typedValue);
                }
                else
                {
                    return XmlUntypedConverter.Untyped.ToDouble(typedValue);
                }
            }
            catch (FormatException e)
            {
                throw new XmlException(SR.Xml_ReadContentAsFormatException, "Double", e, this as IXmlLineInfo);
            }
            catch (InvalidCastException e)
            {
                throw new XmlException(SR.Xml_ReadContentAsFormatException, "Double", e, this as IXmlLineInfo);
            }
            catch (OverflowException e)
            {
                throw new XmlException(SR.Xml_ReadContentAsFormatException, "Double", e, this as IXmlLineInfo);
            }
        }
XsdValidatingReader