Skip to content

Commit

Permalink
Bring XmlReader{Async} to one behavior (#51736)
Browse files Browse the repository at this point in the history
* Replace XmlUntypedStringConverter to XmlUntypedConverter

* Add more test

* add more tests

* remove unssoprt test

* feedback review

Co-authored-by: kronic <kronic@softland.ru>
  • Loading branch information
kronic and kronic authored Sep 20, 2021
1 parent e804766 commit 6c9921d
Show file tree
Hide file tree
Showing 4 changed files with 569 additions and 253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@
<Compile Include="System\Xml\Schema\XmlTokenizedType.cs" />
<Compile Include="System\Xml\Schema\XmlTypeCode.cs" />
<Compile Include="System\Xml\Schema\XmlValueConverter.cs" />
<Compile Include="System\Xml\Schema\XmlUntypedStringConverter.cs" />
<Compile Include="System\Xml\Schema\XsdBuilder.cs" />
<Compile Include="System\Xml\Schema\XsdDateTime.cs" />
<Compile Include="System\Xml\Schema\XsdDuration.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public virtual object ReadContentAs(Type returnType, IXmlNamespaceResolver? name

try
{
return XmlUntypedStringConverter.Instance.FromString(strContentValue, returnType, (namespaceResolver ?? this as IXmlNamespaceResolver)!);
return XmlUntypedConverter.Untyped.ChangeType(strContentValue, returnType, namespaceResolver ?? this as IXmlNamespaceResolver);
}
catch (FormatException e)
{
Expand Down Expand Up @@ -534,7 +534,7 @@ public virtual object ReadElementContentAs(Type returnType, IXmlNamespaceResolve
return value;
}

return returnType == typeof(string) ? string.Empty : XmlUntypedStringConverter.Instance.FromString(string.Empty, returnType, namespaceResolver);
return returnType == typeof(string) ? string.Empty : XmlUntypedConverter.Untyped.ChangeType(string.Empty, returnType, namespaceResolver);
}

// Checks local name and namespace of the current element and returns its content as the requested type.
Expand Down

This file was deleted.

Loading

0 comments on commit 6c9921d

Please sign in to comment.