private static void SavePathToFile(Path path) { try { var writer = new StreamWriter(PathToFile); PathStorage.SavePath(path, writer); } catch (Exception e) { Console.WriteLine(e.Message); } Console.WriteLine("Path saved successfully."); }
private static Path LoadPathFromFile() { Path pathFromFile = new Path(); try { var reader = new StreamReader(PathToFile); pathFromFile = PathStorage.LoadPath(reader); } catch (Exception e) { Console.WriteLine(e.Message); } return(pathFromFile); }