From 1d7ada87c5f35ebcce56b912aefd40e638df6ad4 Mon Sep 17 00:00:00 2001 From: Drew Tingen Date: Tue, 22 Jan 2019 09:47:20 -0800 Subject: [PATCH] refactor: Removing preprocessors and adding better multi-platform support --- ICD.Common.Utils/IO/IcdDirectory.cs | 7 ++++--- ICD.Common.Utils/PathUtils.cs | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ICD.Common.Utils/IO/IcdDirectory.cs b/ICD.Common.Utils/IO/IcdDirectory.cs index 4ae98bf..4b087c5 100644 --- a/ICD.Common.Utils/IO/IcdDirectory.cs +++ b/ICD.Common.Utils/IO/IcdDirectory.cs @@ -19,17 +19,18 @@ namespace ICD.Common.Utils.IO #endif } - -#if SIMPLSHARP /// /// This gets the application root directory for Crestron systems /// /// public static string GetApplicationRootDirectory() { +#if SIMPLSHARP return Directory.GetApplicationRootDirectory(); - } +#else + return Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase); #endif + } public static bool Exists(string path) { diff --git a/ICD.Common.Utils/PathUtils.cs b/ICD.Common.Utils/PathUtils.cs index a4e49da..64e21a6 100644 --- a/ICD.Common.Utils/PathUtils.cs +++ b/ICD.Common.Utils/PathUtils.cs @@ -20,10 +20,9 @@ namespace ICD.Common.Utils public static string RootPath { get { -#if SIMPLSHARP if (IcdEnvironment.RuntimeEnvironment == IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono) return IcdDirectory.GetApplicationRootDirectory(); -#endif + return IcdDirectory.GetDirectoryRoot(IcdPath.DirectorySeparatorChar.ToString()); } }