remove reference of Newtonsoft.Json

This commit is contained in:
Gang Zhuo
2015-10-08 05:57:14 -04:00
parent 29d70acfb5
commit 8bc9a7911b
5 changed files with 38 additions and 26 deletions
@@ -6,7 +6,6 @@ using System.Reflection;
using Shadowsocks.Controller;
using Shadowsocks.Controller.Strategy;
using SimpleJson;
using Newtonsoft.Json;
namespace Shadowsocks.Model
{
@@ -29,10 +28,10 @@ namespace Shadowsocks.Model
try
{
var content = File.ReadAllText(ConfigFile);
var configuration = JsonConvert.DeserializeObject<StatisticsStrategyConfiguration>(content);
var configuration = SimpleJson.SimpleJson.DeserializeObject<StatisticsStrategyConfiguration>(content);
return configuration;
}
catch (FileNotFoundException e)
catch (FileNotFoundException)
{
var configuration = new StatisticsStrategyConfiguration();
Save(configuration);
@@ -49,7 +48,7 @@ namespace Shadowsocks.Model
{
try
{
var content = JsonConvert.SerializeObject(configuration, Formatting.Indented);
var content = SimpleJson.SimpleJson.SerializeObject(configuration);
File.WriteAllText(ConfigFile, content);
}
catch (Exception e)