Merge branch 'master' of https://github.com/ravensorb/Newtonsoft.Json into ravensorb-master

This commit is contained in:
James Newton-King
2015-04-02 20:18:34 +13:00
3 changed files with 31 additions and 5 deletions
@@ -883,8 +883,20 @@ namespace Newtonsoft.Json.Utilities
{
ValidationUtils.ArgumentNotNull(targetType, "targetType");
List<PropertyInfo> propertyInfos = new List<PropertyInfo>(targetType.GetProperties(bindingAttr));
GetChildPrivateProperties(propertyInfos, targetType, bindingAttr);
List<PropertyInfo> propertyInfos;
if (!targetType.IsInterface())
{
propertyInfos = new List<PropertyInfo>(targetType.GetProperties(bindingAttr));
}
else
{
propertyInfos = (new Type[] { targetType })
.Concat(targetType.GetInterfaces())
.SelectMany(i => i.GetProperties(bindingAttr)).ToList();
}
GetChildPrivateProperties(propertyInfos, targetType, bindingAttr);
// a base class private getter/setter will be inaccessable unless the property was gotten from the base class
for (int i = 0; i < propertyInfos.Count; i++)