From 099517df7d707b00b5e64d6c88d40d5ab570e114 Mon Sep 17 00:00:00 2001 From: Drew Tingen Date: Mon, 16 Sep 2019 14:00:47 -0400 Subject: [PATCH 1/2] feat: Adding program data path to PathUtils --- ICD.Common.Utils/PathUtils.cs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ICD.Common.Utils/PathUtils.cs b/ICD.Common.Utils/PathUtils.cs index bf53748..a32307a 100644 --- a/ICD.Common.Utils/PathUtils.cs +++ b/ICD.Common.Utils/PathUtils.cs @@ -84,6 +84,37 @@ namespace ICD.Common.Utils } } + /// + /// Returns the absolute path to the program data directory. + /// + /// + [PublicAPI] + public static string ProgramDataPath { get { return Join(RootConfigPath, ProgramDataDirectory); } } + + /// + /// Returns the name of the program data directory. + /// This directory contains runtime program data that should be retained through deployments. + /// + public static string ProgramDataDirectory + { + get + { + switch (IcdEnvironment.RuntimeEnvironment) + { + case IcdEnvironment.eRuntimeEnvironment.SimplSharp: + case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro: + case IcdEnvironment.eRuntimeEnvironment.Standard: + return string.Format("Program{0:D2}Data", ProgramUtils.ProgramNumber); + + case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono: + return "ProgramData"; + + default: + throw new ArgumentOutOfRangeException(); + } + } + } + /// /// Returns the absolute path to the common configuration directory. /// From 73b1c4819c3fb364ee01a9f3a8b7739b35d93ec8 Mon Sep 17 00:00:00 2001 From: Drew Tingen Date: Mon, 16 Sep 2019 14:10:45 -0400 Subject: [PATCH 2/2] chore: Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed2f268..84f43c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added CultureInfo extensions for converting between 12 hour and 24 hour time formatting - Added environment methods for setting the current date and time - Added BinarySearch extension method for all IList types + - Added PathUtils methods to get ProgramData directory ### Changed - The Root Config path in Net Standard will now be the ICD.Connect folder in the current environments ProgramData directory