WIP: Major update #45

Closed
Hesham wants to merge 16 commits from develop-laptop into master
2 changed files with 12 additions and 9 deletions
Showing only changes of commit 2e78d7ccfe - Show all commits

View File

@ -92,7 +92,7 @@ namespace OWTrack
}
catch (Exception)
{
MessageBox.Show("Could not load Save.\n" +
MessageBox.Show("Could not load Save!\n" +
"Starting new save.");
tr = new Tracker();
}

View File

@ -33,6 +33,10 @@ namespace OWTrack
public static string GetSaves() { return SAVES; }
public static string GetCurrentDir() { return curDir; }
/// <summary>
/// Paths of 'Program Files' folders.
/// </summary>
/// <returns></returns>
public struct ProgramFiles
{
public const string C = "C:\\Program Files";
@ -47,17 +51,16 @@ namespace OWTrack
/// <summary>
/// Deserialize saved tracker instance.
/// </summary>
/// <returns></returns>
/// <returns>Tracker</returns>
public static Tracker GetSavedTracker()
{
try
{
return JsonConvert.DeserializeObject<Tracker>(File.ReadAllText(Paths.GetSaves()));
}
catch (Exception)
catch (Exception e)
{
Exception ex = new Exception("json");
throw ex;
throw e;
}
}
@ -81,8 +84,8 @@ namespace OWTrack
/// <summary>
///Saves the Tracker Object.
/// </summary>
/// <param name="tracker"></param>
/// <returns></returns>
/// <param name="Tracker"></param>
/// <returns>Boolean Value</returns>
public static bool SaveJSON(Tracker tracker)
{
try
@ -90,9 +93,9 @@ namespace OWTrack
File.WriteAllText(Paths.GetSaves(), JsonConvert.SerializeObject(tracker, Formatting.Indented));
return true;
}
catch (Exception)
catch (Exception e)
{
return false;
throw e;
}
}