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

ReadElementContentAsStringAsync() public méthode

public ReadElementContentAsStringAsync ( ) : Task
Résultat Task
        public override async Task<string> ReadElementContentAsStringAsync()
        {
            if (this.NodeType != XmlNodeType.Element)
            {
                throw CreateReadElementContentAsException(nameof(ReadElementContentAsString));
            }
            XmlSchemaType xmlType;

            var tuple_9 = await InternalReadElementContentAsObjectAsync().ConfigureAwait(false);
            xmlType = tuple_9.Item1;

            object typedValue = tuple_9.Item2;

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