2013-02-18 02:10:21 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
2013-01-25 19:03:28 +00:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Api.Extentions
|
|
|
|
|
{
|
|
|
|
|
public static class Serializer
|
|
|
|
|
{
|
|
|
|
|
static Serializer()
|
|
|
|
|
{
|
|
|
|
|
Settings = new JsonSerializerSettings
|
|
|
|
|
{
|
|
|
|
|
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
|
|
|
|
|
NullValueHandling = NullValueHandling.Ignore,
|
2013-02-15 06:46:42 +00:00
|
|
|
|
Formatting = Formatting.Indented,
|
2013-01-25 19:03:28 +00:00
|
|
|
|
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Instance = new JsonSerializer
|
|
|
|
|
{
|
|
|
|
|
DateTimeZoneHandling = Settings.DateTimeZoneHandling,
|
|
|
|
|
NullValueHandling = NullValueHandling.Ignore,
|
2013-02-15 06:46:42 +00:00
|
|
|
|
Formatting = Formatting.Indented,
|
2013-01-25 19:03:28 +00:00
|
|
|
|
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
|
|
|
|
|
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static JsonSerializerSettings Settings { get; private set; }
|
|
|
|
|
|
|
|
|
|
public static JsonSerializer Instance { get; private set; }
|
|
|
|
|
}
|
|
|
|
|
}
|