-Added FloatFormatHandling to JsonWriter/JsonSerializer/JsonSerializerSettings

-Added DateFormatString to JsonWriter/JsonSerializer/JsonSerializerSettings
-Changed StringEnumConverter to convert an empty string to null for nullable enums
-Changed NaN and Infinity floating point values to be serialized as strings by default
This commit is contained in:
James Newton-King
2013-02-02 14:55:28 +13:00
parent f98c6a0d8d
commit 0db89bf5fa
21 changed files with 521 additions and 24 deletions
+21
View File
@@ -210,6 +210,9 @@ namespace Newtonsoft.Json
private DateFormatHandling _dateFormatHandling;
private DateTimeZoneHandling _dateTimeZoneHandling;
private StringEscapeHandling _stringEscapeHandling;
private FloatFormatHandling _floatFormatHandling;
private string _dateFormatString;
private CultureInfo _culture;
/// <summary>
/// Indicates how JSON text output is formatted.
@@ -247,6 +250,24 @@ namespace Newtonsoft.Json
set { _stringEscapeHandling = value; }
}
public FloatFormatHandling FloatFormatHandling
{
get { return _floatFormatHandling; }
set { _floatFormatHandling = value; }
}
public string DateFormatString
{
get { return _dateFormatString; }
set { _dateFormatString = value; }
}
public CultureInfo Culture
{
get { return _culture ?? CultureInfo.InvariantCulture; }
set { _culture = value; }
}
/// <summary>
/// Creates an instance of the <c>JsonWriter</c> class.
/// </summary>