Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadContentAsAsync()

virtual async Task< object > System.Xml.XmlReader.ReadContentAsAsync ( Type returnType,
IXmlNamespaceResolver? namespaceResolver )
inlinevirtualinherited

Definition at line 1518 of file XmlReader.cs.

1519 {
1520 if (!CanReadContentAs())
1521 {
1522 throw CreateReadContentAsException("ReadContentAs");
1523 }
1525 if (returnType == typeof(string))
1526 {
1527 return text;
1528 }
1529 try
1530 {
1531 return XmlUntypedConverter.Untyped.ChangeType(text, returnType, namespaceResolver ?? (this as IXmlNamespaceResolver));
1532 }
1533 catch (FormatException innerException)
1534 {
1535 throw new XmlException(System.SR.Xml_ReadContentAsFormatException, returnType.ToString(), innerException, this as IXmlLineInfo);
1536 }
1537 catch (InvalidCastException innerException2)
1538 {
1539 throw new XmlException(System.SR.Xml_ReadContentAsFormatException, returnType.ToString(), innerException2, this as IXmlLineInfo);
1540 }
1541 }
static string Xml_ReadContentAsFormatException
Definition SR.cs:190
Definition SR.cs:7
static readonly XmlValueConverter Untyped
async Task< string > InternalReadContentAsStringAsync()
Exception CreateReadContentAsException(string methodName)

References System.Xml.XmlReader.CanReadContentAs(), System.Xml.XmlReader.CreateReadContentAsException(), System.Xml.Dictionary, System.Xml.XmlReader.InternalReadContentAsStringAsync(), System.text, System.Xml.Schema.XmlUntypedConverter.Untyped, System.SR.Xml_ReadContentAsFormatException, and System.Xml.XmlException.

Referenced by System.Xml.XmlAsyncCheckReader.ReadContentAsAsync(), System.Xml.XmlSubtreeReader.ReadContentAsAsync(), and System.Xml.XmlReader.ReadElementContentAsAsync().