From f1831c78a896c78e72a2860b0d8643552d8f3458 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Sun, 9 Dec 2018 16:45:22 +0300 Subject: [PATCH 1/3] Rough code. Not tested. --- OWTrack/saveManeger.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OWTrack/saveManeger.cs b/OWTrack/saveManeger.cs index 84f2045..623d22e 100644 --- a/OWTrack/saveManeger.cs +++ b/OWTrack/saveManeger.cs @@ -74,7 +74,9 @@ namespace OWTrack { try { - File.WriteAllText(Paths.SAVES, JsonConvert.SerializeObject(tracker)); + JsonConvert json = new JsonConvert();//Not tested + json.Formatting = Formatting.Indented; + File.WriteAllText(Paths.SAVES, json.SerializeObject(tracker));//check if (Indented) Parameter exists return true; } catch (Exception) From b9f9dd7cff58857c2a08e84ded1774558e6191b6 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Sun, 9 Dec 2018 16:53:35 +0300 Subject: [PATCH 2/3] Link --- OWTrack/saveManeger.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OWTrack/saveManeger.cs b/OWTrack/saveManeger.cs index 623d22e..7a82daa 100644 --- a/OWTrack/saveManeger.cs +++ b/OWTrack/saveManeger.cs @@ -74,6 +74,7 @@ namespace OWTrack { try { + //https://stackoverflow.com/questions/7947005/how-to-turn-on-indentation-when-writing-json-using-json-net JsonConvert json = new JsonConvert();//Not tested json.Formatting = Formatting.Indented; File.WriteAllText(Paths.SAVES, json.SerializeObject(tracker));//check if (Indented) Parameter exists From 9a05516dad3d0ae9a942f66deb05b93490dc73f9 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Mon, 10 Dec 2018 09:23:47 +0300 Subject: [PATCH 3/3] corrected --- OWTrack/OWTrack.csproj | 4 ++-- OWTrack/packages.config | 2 +- OWTrack/saveManeger.cs | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/OWTrack/OWTrack.csproj b/OWTrack/OWTrack.csproj index a482454..9a402fc 100644 --- a/OWTrack/OWTrack.csproj +++ b/OWTrack/OWTrack.csproj @@ -90,8 +90,8 @@ assets\Jeanette-Foshee-Simpsons-11-Rollover-Homer-donut-1.ico - - ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/OWTrack/packages.config b/OWTrack/packages.config index 5762754..466ab76 100644 --- a/OWTrack/packages.config +++ b/OWTrack/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/OWTrack/saveManeger.cs b/OWTrack/saveManeger.cs index 7a82daa..b93e935 100644 --- a/OWTrack/saveManeger.cs +++ b/OWTrack/saveManeger.cs @@ -73,11 +73,8 @@ namespace OWTrack public static bool SaveJSON(Tracker tracker) { try - { - //https://stackoverflow.com/questions/7947005/how-to-turn-on-indentation-when-writing-json-using-json-net - JsonConvert json = new JsonConvert();//Not tested - json.Formatting = Formatting.Indented; - File.WriteAllText(Paths.SAVES, json.SerializeObject(tracker));//check if (Indented) Parameter exists + { + File.WriteAllText(Paths.SAVES, JsonConvert.SerializeObject(tracker, Formatting.Indented)); return true; } catch (Exception)