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

ReadElementContentAsFloat() public method

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

            object typedValue = InternalReadElementContentAsObject(out xmlType);

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