-Added XmlDocument support to netstandard1.3+

This commit is contained in:
James Newton-King
2017-03-16 23:36:11 +13:00
parent bcd96b8744
commit ae3ae96832
11 changed files with 101 additions and 53 deletions
@@ -551,7 +551,7 @@ namespace Newtonsoft.Json.Utilities
#endif
}
public static bool AssignableToTypeName(this Type type, string fullTypeName, out Type match)
public static bool AssignableToTypeName(this Type type, string fullTypeName, bool searchInterfaces, out Type match)
{
Type current = type;
@@ -566,12 +566,15 @@ namespace Newtonsoft.Json.Utilities
current = current.BaseType();
}
foreach (Type i in type.GetInterfaces())
if (searchInterfaces)
{
if (string.Equals(i.Name, fullTypeName, StringComparison.Ordinal))
foreach (Type i in type.GetInterfaces())
{
match = type;
return true;
if (string.Equals(i.Name, fullTypeName, StringComparison.Ordinal))
{
match = type;
return true;
}
}
}
@@ -579,10 +582,10 @@ namespace Newtonsoft.Json.Utilities
return false;
}
public static bool AssignableToTypeName(this Type type, string fullTypeName)
public static bool AssignableToTypeName(this Type type, string fullTypeName, bool searchInterfaces)
{
Type match;
return type.AssignableToTypeName(fullTypeName, out match);
return type.AssignableToTypeName(fullTypeName, searchInterfaces, out match);
}
public static bool ImplementInterface(this Type type, Type interfaceType)