From 8d85f6b8a2e1a15ff9ac8e0443bba9027afcd206 Mon Sep 17 00:00:00 2001 From: Alee14 Date: Sat, 1 Sep 2018 19:07:41 -0400 Subject: moved the create directory to file system class --- PortEngine/FileSystem.cs | 18 ++++++++++++++++-- Project Ports/MainMenu.cs | 5 +---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/PortEngine/FileSystem.cs b/PortEngine/FileSystem.cs index 35f7ee6..af81225 100644 --- a/PortEngine/FileSystem.cs +++ b/PortEngine/FileSystem.cs @@ -26,8 +26,22 @@ using System.Threading.Tasks; namespace PortEngine { - class FileSystem + public class FileSystem { - + public static string appDataFolder + { + get + { + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Project Ports"); + } + } + + public static void CreateDataFolder() + { + + if (!Directory.Exists(appDataFolder)) + Directory.CreateDirectory(appDataFolder); + } + } } diff --git a/Project Ports/MainMenu.cs b/Project Ports/MainMenu.cs index d97a672..bafcc22 100644 --- a/Project Ports/MainMenu.cs +++ b/Project Ports/MainMenu.cs @@ -76,10 +76,7 @@ namespace Project_Ports #endif portsVersion.Text = Properties.Settings.Default.version; - string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - string path = Path.Combine(appDataPath, "Project Ports"); - if (!Directory.Exists(path)) - Directory.CreateDirectory(path); + FileSystem.CreateDataFolder(); } } -- cgit v1.2.3