Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/Newtonsoft.Json.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs')
-rw-r--r--Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs18
1 files changed, 16 insertions, 2 deletions
diff --git a/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs b/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs
index ce4ea62..6199e99 100644
--- a/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs
+++ b/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs
@@ -34,7 +34,6 @@ using System.ComponentModel;
using System.Dynamic;
#endif
using System.Globalization;
-using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
#if !NETFX_CORE
@@ -48,6 +47,11 @@ using System.Runtime.CompilerServices;
#if NETFX_CORE
using ICustomAttributeProvider = Newtonsoft.Json.Utilities.CustomAttributeProvider;
#endif
+#if NET20
+using Newtonsoft.Json.Utilities.LinqBridge;
+#else
+using System.Linq;
+#endif
namespace Newtonsoft.Json.Serialization
{
@@ -147,6 +151,16 @@ namespace Newtonsoft.Json.Serialization
/// </value>
public bool SerializeCompilerGeneratedMembers { get; set; }
+#if !SILVERLIGHT && !PocketPC && !NETFX_CORE
+ /// <summary>
+ /// Gets or sets a value indicating whether to ignore the ISerializable interface when serializing and deserializing types.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if the ISerializable interface will be ignored when serializing and deserializing types; otherwise, <c>false</c>.
+ /// </value>
+ public bool IgnoreSerializableInterface { get; set; }
+#endif
+
/// <summary>
/// Initializes a new instance of the <see cref="DefaultContractResolver"/> class.
/// </summary>
@@ -686,7 +700,7 @@ namespace Newtonsoft.Json.Serialization
return CreateStringContract(objectType);
#if !SILVERLIGHT && !PocketPC && !NETFX_CORE
- if (typeof(ISerializable).IsAssignableFrom(t))
+ if (!IgnoreSerializableInterface && typeof(ISerializable).IsAssignableFrom(t))
return CreateISerializableContract(objectType);
#endif