Merge branch 'ravensorb-master'
This commit is contained in:
@@ -47,7 +47,12 @@ using NUnit.Framework;
|
|||||||
|
|
||||||
namespace Newtonsoft.Json.Tests.Serialization
|
namespace Newtonsoft.Json.Tests.Serialization
|
||||||
{
|
{
|
||||||
public interface ITaskRepository
|
public interface IBase
|
||||||
|
{
|
||||||
|
DateTime CreatedOn { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ITaskRepository : IBase
|
||||||
{
|
{
|
||||||
string ConnectionString { get; set; }
|
string ConnectionString { get; set; }
|
||||||
}
|
}
|
||||||
@@ -58,7 +63,12 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
string Level { get; set; }
|
string Level { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TaskRepository : ITaskRepository
|
public class Base : IBase
|
||||||
|
{
|
||||||
|
public DateTime CreatedOn { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TaskRepository : Base, ITaskRepository
|
||||||
{
|
{
|
||||||
public string ConnectionString { get; set; }
|
public string ConnectionString { get; set; }
|
||||||
}
|
}
|
||||||
@@ -202,7 +212,8 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
'Level': 'Debug'
|
'Level': 'Debug'
|
||||||
},
|
},
|
||||||
'Repository': {
|
'Repository': {
|
||||||
'ConnectionString': 'server=.'
|
'ConnectionString': 'server=.',
|
||||||
|
'CreatedOn': '2015-04-01 20:00'
|
||||||
},
|
},
|
||||||
'People': [
|
'People': [
|
||||||
{
|
{
|
||||||
@@ -216,13 +227,14 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
'Name': 'Name3!'
|
'Name': 'Name3!'
|
||||||
}
|
}
|
||||||
}", new JsonSerializerSettings
|
}", new JsonSerializerSettings
|
||||||
{
|
{
|
||||||
ContractResolver = contractResolver
|
ContractResolver = contractResolver
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.IsNotNull(o);
|
Assert.IsNotNull(o);
|
||||||
Assert.IsNotNull(o.Logger);
|
Assert.IsNotNull(o.Logger);
|
||||||
Assert.IsNotNull(o.Repository);
|
Assert.IsNotNull(o.Repository);
|
||||||
|
Assert.AreEqual(o.Repository.CreatedOn, DateTime.Parse("2015-04-01 20:00"));
|
||||||
|
|
||||||
Assert.AreEqual(2, count);
|
Assert.AreEqual(2, count);
|
||||||
|
|
||||||
|
|||||||
@@ -2,5 +2,4 @@
|
|||||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
</wpf:ResourceDictionary>
|
</wpf:ResourceDictionary>
|
||||||
@@ -884,6 +884,16 @@ namespace Newtonsoft.Json.Utilities
|
|||||||
ValidationUtils.ArgumentNotNull(targetType, "targetType");
|
ValidationUtils.ArgumentNotNull(targetType, "targetType");
|
||||||
|
|
||||||
List<PropertyInfo> propertyInfos = new List<PropertyInfo>(targetType.GetProperties(bindingAttr));
|
List<PropertyInfo> propertyInfos = new List<PropertyInfo>(targetType.GetProperties(bindingAttr));
|
||||||
|
|
||||||
|
// GetProperties on an interface doesn't return properties from its interfaces
|
||||||
|
if (targetType.IsInterface())
|
||||||
|
{
|
||||||
|
foreach (Type i in targetType.GetInterfaces())
|
||||||
|
{
|
||||||
|
propertyInfos.AddRange(i.GetProperties(bindingAttr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GetChildPrivateProperties(propertyInfos, targetType, bindingAttr);
|
GetChildPrivateProperties(propertyInfos, targetType, bindingAttr);
|
||||||
|
|
||||||
// a base class private getter/setter will be inaccessable unless the property was gotten from the base class
|
// a base class private getter/setter will be inaccessable unless the property was gotten from the base class
|
||||||
|
|||||||
Reference in New Issue
Block a user