From 2b23479079a55bc0b964645c0849143532b66bfc Mon Sep 17 00:00:00 2001 From: hesham Date: Wed, 23 Jan 2019 12:08:01 +0300 Subject: [PATCH] Move Paths Struct with Comments and Version bump --- OWTrack/OWTrack.csproj | 1 + OWTrack/Paths.cs | 67 ++++++++++++++++++++++++++++++++++++++++++ OWTrack/Program.cs | 2 +- OWTrack/saveManeger.cs | 18 ------------ 4 files changed, 69 insertions(+), 19 deletions(-) create mode 100644 OWTrack/Paths.cs diff --git a/OWTrack/OWTrack.csproj b/OWTrack/OWTrack.csproj index a6997e9..8e72130 100644 --- a/OWTrack/OWTrack.csproj +++ b/OWTrack/OWTrack.csproj @@ -112,6 +112,7 @@ MainForm.cs + diff --git a/OWTrack/Paths.cs b/OWTrack/Paths.cs new file mode 100644 index 0000000..6e01715 --- /dev/null +++ b/OWTrack/Paths.cs @@ -0,0 +1,67 @@ +/*Copyright(c) 2018 Hesham Systems LLC. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.*/ + +using System.IO; + +namespace OWTrack +{ + public struct Paths + { + /// + /// Current Application directory. + /// + private static string curDir = Directory.GetCurrentDirectory(); + + /// + /// Saves Folder relative path. \n Relative to Application Directory. + /// + private static string SAVES = curDir + "/saves/data.json"; + + /// + /// Saves Folder relative path. \n Relative to Application Directory. + /// + private static string JSON = curDir + "/data.json"; + + public static string GetJSON() { return JSON; }//TODO: Unused var + + /// + /// Get Saves file Path. + /// + /// + public static string GetSaves() { return SAVES; } + + /// + /// Get Current Application directory. + /// + /// + public static string GetCurrentDir() { return curDir; } + + /// + /// "Program Files" standered constant paths. + /// + public struct ProgramFiles + { + public const string C = "C:\\Program Files"; + public const string D = "D:\\Program Files"; + public const string E = "E:\\Program Files"; + public const string F = "F:\\Program Files"; + } + } +} diff --git a/OWTrack/Program.cs b/OWTrack/Program.cs index 1d1b8d4..824fb47 100644 --- a/OWTrack/Program.cs +++ b/OWTrack/Program.cs @@ -17,6 +17,6 @@ namespace OWTrack Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } - public static string Version { get; } = "1.4.3"; + public static string Version { get; } = "1.4.4.a1"; } } diff --git a/OWTrack/saveManeger.cs b/OWTrack/saveManeger.cs index 74d29a0..6367287 100644 --- a/OWTrack/saveManeger.cs +++ b/OWTrack/saveManeger.cs @@ -24,24 +24,6 @@ using System.IO; namespace OWTrack { - public struct Paths - { - private static string curDir = Directory.GetCurrentDirectory(); - private static string SAVES = curDir + "/saves/data.json"; - private static string JSON = curDir + "/data.json"; - public static string GetJSON() { return JSON; } - public static string GetSaves() { return SAVES; } - public static string GetCurrentDir() { return curDir; } - - public struct ProgramFiles - { - public const string C = "C:\\Program Files"; - public const string D = "D:\\Program Files"; - public const string E = "E:\\Program Files"; - public const string F = "F:\\Program Files"; - } - } - class saveManeger { ///