-Added XmlDocument support to netstandard1.3+
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user