Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replacing json serialization library with Newtonsoft.Json for indente…

…d formatting of the .giles save file (for readability)
  • Loading branch information...
commit 1d569a250da2ba211a16c8e3efe92a46ee9d59f8 1 parent 526eda6
Jeff Schumacher authored
BIN  lib/Newtonsoft.Json.4.0.8/Newtonsoft.Json.4.0.8.nupkg
View
Binary file not shown
BIN  lib/Newtonsoft.Json.4.0.8/lib/net40/Newtonsoft.Json.dll
View
Binary file not shown
BIN  lib/Newtonsoft.Json.4.0.8/lib/net40/Newtonsoft.Json.pdb
View
Binary file not shown
7,004 lib/Newtonsoft.Json.4.0.8/lib/net40/Newtonsoft.Json.xml
View
7,004 additions, 0 deletions not shown
4 src/Giles.Core/Configuration/GilesConfig.cs
View
@@ -1,13 +1,13 @@
using System.Collections.Generic;
using System.ComponentModel;
-using System.Web.Script.Serialization;
using Giles.Core.UI;
+using Newtonsoft.Json;
namespace Giles.Core.Configuration
{
public class GilesConfig : INotifyPropertyChanged
{
- [ScriptIgnore]
+ [JsonIgnore]
public List<IUserDisplay> UserDisplay = new List<IUserDisplay>();
private long buildDelay = 500;
public List<string> Filters { get; set; }
7 src/Giles.Core/Configuration/GilesConfigBuilder.cs
View
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.IO;
-using System.Web.Script.Serialization;
using Giles.Core.UI;
+using Newtonsoft.Json;
namespace Giles.Core.Configuration
{
@@ -21,7 +21,7 @@ public GilesConfig Build()
{
var path = GilesConfigPath(solutionPath);
if (File.Exists(path))
- config = new JavaScriptSerializer().Deserialize<GilesConfig>(File.ReadAllText(path));
+ config = JsonConvert.DeserializeObject<GilesConfig>(File.ReadAllText(path));
else
{
config.TestAssemblies = testAssemblies;
@@ -35,8 +35,7 @@ public GilesConfig Build()
public static string Save(GilesConfig config)
{
- var serializer = new JavaScriptSerializer();
- var data = serializer.Serialize(config);
+ var data = JsonConvert.SerializeObject(config, Formatting.Indented);
var path = GilesConfigPath(config.SolutionPath);
File.WriteAllText(path, data);
4 src/Giles.Core/Giles.Core.csproj
View
@@ -98,12 +98,14 @@
<Reference Include="Growl.CoreLibrary">
<HintPath>..\..\lib\Growl.Connector\Growl.CoreLibrary.dll</HintPath>
</Reference>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\..\lib\Newtonsoft.Json.4.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Security" />
- <Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
Please sign in to comment.
Something went wrong with that request. Please try again.