aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlee14 <alee14498@gmail.com>2018-09-01 19:07:41 -0400
committerAlee14 <alee14498@gmail.com>2018-09-01 19:07:41 -0400
commit8d85f6b8a2e1a15ff9ac8e0443bba9027afcd206 (patch)
tree84dc3e098295330cda4733b3de8201954eff88f3
parent56cb0866c40c97d7dc50e6e2a339c1b957347010 (diff)
downloadProject-Silicon-8d85f6b8a2e1a15ff9ac8e0443bba9027afcd206.tar.gz
Project-Silicon-8d85f6b8a2e1a15ff9ac8e0443bba9027afcd206.tar.bz2
Project-Silicon-8d85f6b8a2e1a15ff9ac8e0443bba9027afcd206.zip
moved the create directory to file system class
-rw-r--r--PortEngine/FileSystem.cs18
-rw-r--r--Project Ports/MainMenu.cs5
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();
}
}