mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
Merge branch 'feat/VC-4' of Common/Utils into MetLife_v5.4
This commit is contained in:
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
- Added SimplSharpProMono to eRuntimeEnvironment enum
|
- Added SimplSharpProMono to eRuntimeEnvironment enum
|
||||||
|
- Added path support for SimplSharpProMono environment
|
||||||
|
- Added GetApplicationRootDirectory for all platforms
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Small fixes for better VC4 support
|
- Small fixes for better VC4 support
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using ICD.Common.Utils.Extensions;
|
||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
#else
|
#else
|
||||||
@@ -19,6 +20,19 @@ namespace ICD.Common.Utils.IO
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This gets the application root directory for Crestron systems
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetApplicationRootDirectory()
|
||||||
|
{
|
||||||
|
#if SIMPLSHARP
|
||||||
|
return Directory.GetApplicationRootDirectory();
|
||||||
|
#else
|
||||||
|
return Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetPath());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
public static bool Exists(string path)
|
public static bool Exists(string path)
|
||||||
{
|
{
|
||||||
if (path == null)
|
if (path == null)
|
||||||
|
|||||||
@@ -17,7 +17,15 @@ namespace ICD.Common.Utils
|
|||||||
/// Gets the path to the root directory of the processor.
|
/// Gets the path to the root directory of the processor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public static string RootPath { get { return IcdDirectory.GetDirectoryRoot("\\"); } }
|
public static string RootPath {
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (IcdEnvironment.RuntimeEnvironment == IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono)
|
||||||
|
return IcdDirectory.GetApplicationRootDirectory();
|
||||||
|
|
||||||
|
return IcdDirectory.GetDirectoryRoot(IcdPath.DirectorySeparatorChar.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the path to the program directory
|
/// Gets the path to the program directory
|
||||||
@@ -35,7 +43,7 @@ namespace ICD.Common.Utils
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
return Join(RootPath, "USER");
|
return Join(RootPath, "User");
|
||||||
#elif LINUX
|
#elif LINUX
|
||||||
return Join(RootPath, "opt", "ICD.Connect");
|
return Join(RootPath, "opt", "ICD.Connect");
|
||||||
#else
|
#else
|
||||||
@@ -53,6 +61,9 @@ namespace ICD.Common.Utils
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
if (IcdEnvironment.RuntimeEnvironment == IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono)
|
||||||
|
return Join(RootConfigPath, "ProgramConfig");
|
||||||
|
|
||||||
string directoryName = string.Format("Program{0:D2}Config", ProgramUtils.ProgramNumber);
|
string directoryName = string.Format("Program{0:D2}Config", ProgramUtils.ProgramNumber);
|
||||||
return Join(RootConfigPath, directoryName);
|
return Join(RootConfigPath, directoryName);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user