System.Xml.XsdValidatingReader.ReadElementContentAsLong C# (CSharp) Méthode

ReadElementContentAsLong() public méthode

public ReadElementContentAsLong ( ) : long
Résultat long
        public override long ReadElementContentAsLong()
        {
            if (this.NodeType != XmlNodeType.Element)
            {
                throw CreateReadElementContentAsException(nameof(ReadElementContentAsLong));
            }
            XmlSchemaType xmlType;

            object typedValue = InternalReadElementContentAsObject(out xmlType);

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