Exemplo n.º 1
0
        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.");
        }
Exemplo n.º 2
0
        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);
        }