-Added support for enum values to LINQ to JSON

-Added TypeNameAssemblyFormat property to JsonSerializer. Property controls whether .NET type names are written with a full or partial assembly name
-Added TypeNameHandling to JsonProperty attribute. Allows a type names to be included on an individual property basis
-Fixed serializing HashSet<T>
-Additional permission demands added to DynamicCodeGeneration flag
This commit is contained in:
JamesNK
2010-04-02 09:56:43 +00:00
parent 0f148a9788
commit f7cc6abfd9
28 changed files with 355 additions and 79 deletions
+19
View File
@@ -26,6 +26,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Utilities;
@@ -42,6 +43,7 @@ namespace Newtonsoft.Json
{
#region Properties
private TypeNameHandling _typeNameHandling;
private FormatterAssemblyStyle _typeNameAssemblyFormat;
private PreserveReferencesHandling _preserveReferencesHandling;
private ReferenceLoopHandling _referenceLoopHandling;
private MissingMemberHandling _missingMemberHandling;
@@ -114,6 +116,22 @@ namespace Newtonsoft.Json
}
}
/// <summary>
/// Gets or sets how a type name assembly is written and resolved by the serializer.
/// </summary>
/// <value>The type name assembly format.</value>
public virtual FormatterAssemblyStyle TypeNameAssemblyFormat
{
get { return _typeNameAssemblyFormat; }
set
{
if (value < FormatterAssemblyStyle.Simple || value > FormatterAssemblyStyle.Full)
throw new ArgumentOutOfRangeException("value");
_typeNameAssemblyFormat = value;
}
}
/// <summary>
/// Gets or sets how object references are preserved by the serializer.
/// </summary>
@@ -296,6 +314,7 @@ namespace Newtonsoft.Json
jsonSerializer.Converters.AddRange(settings.Converters);
jsonSerializer.TypeNameHandling = settings.TypeNameHandling;
jsonSerializer.TypeNameAssemblyFormat = settings.TypeNameAssemblyFormat;
jsonSerializer.PreserveReferencesHandling = settings.PreserveReferencesHandling;
jsonSerializer.ReferenceLoopHandling = settings.ReferenceLoopHandling;
jsonSerializer.MissingMemberHandling = settings.MissingMemberHandling;