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

◆ ReadContentAsAsync() [1/2]

override async Task< object > System.Xml.XsdValidatingReader.ReadContentAsAsync ( Type returnType,
IXmlNamespaceResolver namespaceResolver )
inline

Definition at line 2156 of file XsdValidatingReader.cs.

2157 {
2158 if (!XmlReader.CanReadContentAs(NodeType))
2159 {
2160 throw CreateReadContentAsException("ReadContentAs");
2161 }
2163 string item = tuple.Item1;
2164 object value = tuple.Item2;
2165 XmlSchemaType xmlSchemaType = ((NodeType == XmlNodeType.Attribute) ? AttributeXmlType : ElementXmlType);
2166 try
2167 {
2168 if (xmlSchemaType != null)
2169 {
2170 if (returnType == typeof(DateTimeOffset) && xmlSchemaType.Datatype is Datatype_dateTimeBase)
2171 {
2172 value = item;
2173 }
2174 return xmlSchemaType.ValueConverter.ChangeType(value, returnType);
2175 }
2177 }
2178 catch (FormatException innerException)
2179 {
2181 }
2182 catch (InvalidCastException innerException2)
2183 {
2185 }
2186 catch (OverflowException innerException3)
2187 {
2189 }
2190 }
static string Xml_ReadContentAsFormatException
Definition SR.cs:190
Definition SR.cs:7
static readonly XmlValueConverter Untyped
Exception CreateReadContentAsException(string methodName)
async Task<(string, object)> InternalReadContentAsObjectTupleAsync(bool unwrapTypedValue)

References System.Xml.XsdValidatingReader.AttributeXmlType, System.Xml.XmlReader.CanReadContentAs(), System.Xml.XmlReader.CreateReadContentAsException(), System.Xml.Dictionary, System.Xml.XsdValidatingReader.ElementXmlType, System.Xml.XsdValidatingReader.InternalReadContentAsObjectTupleAsync(), System.item, System.Xml.XsdValidatingReader.NodeType, System.Xml.Schema.XmlUntypedConverter.Untyped, System.value, System.SR.Xml_ReadContentAsFormatException, and System.Xml.XmlException.