diff --git a/OWTrack/MainForm.cs b/OWTrack/MainForm.cs index 5a09b97..f5a07ff 100644 --- a/OWTrack/MainForm.cs +++ b/OWTrack/MainForm.cs @@ -155,7 +155,7 @@ namespace OWTrack } else srLabel.Text = tr.startSR.ToString() + " - " + tr.srDiff(); srTextBox.Text = null; - File.WriteAllText(Paths.SAVES, JsonConvert.SerializeObject(tr)); + saveManeger.SaveJSON(tr); } #region Events diff --git a/OWTrack/saveManeger.cs b/OWTrack/saveManeger.cs index 8e83a88..0c7d370 100644 --- a/OWTrack/saveManeger.cs +++ b/OWTrack/saveManeger.cs @@ -37,6 +37,10 @@ namespace OWTrack class saveManeger { + /// + /// Deserialize saved tracker instance. + /// + /// public static Tracker GetSavedTracker() { try @@ -49,7 +53,6 @@ namespace OWTrack } } - //TODO: use para public static Tracker GetSavedTracker(string customPath) { try @@ -62,11 +65,16 @@ namespace OWTrack } } + /// + ///Saves the Tracker Object. + /// + /// + /// public static bool SaveJSON(Tracker tracker) { try { - File.WriteAllText(Paths.JSON, JsonConvert.SerializeObject(tracker)); + File.WriteAllText(Directory.GetCurrentDirectory() + "/data.json", JsonConvert.SerializeObject(tracker)); return true; } catch (Exception) @@ -75,6 +83,10 @@ namespace OWTrack } } + /// + /// Check if a 'data.json' exists in the default location '../saves/data.json'. + /// + /// Boolean Value public static bool saveExist() { try