mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-14 13:07:28 +00:00
feat: Path support for VC-4
This commit is contained in:
parent
aae4fb6185
commit
a9d411dcfd
2 changed files with 38 additions and 3 deletions
|
|
@ -19,6 +19,18 @@ namespace ICD.Common.Utils.IO
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if SIMPLSHARP
|
||||||
|
/// <summary>
|
||||||
|
/// This gets the application root directory for Crestron systems
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetApplicationRootDirectory()
|
||||||
|
{
|
||||||
|
return Directory.GetApplicationRootDirectory();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
public static bool Exists(string path)
|
public static bool Exists(string path)
|
||||||
{
|
{
|
||||||
if (path == null)
|
if (path == null)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ using System.Linq;
|
||||||
using ICD.Common.Properties;
|
using ICD.Common.Properties;
|
||||||
using ICD.Common.Utils.Extensions;
|
using ICD.Common.Utils.Extensions;
|
||||||
using ICD.Common.Utils.IO;
|
using ICD.Common.Utils.IO;
|
||||||
|
#if SIMPLSHARP
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace ICD.Common.Utils
|
namespace ICD.Common.Utils
|
||||||
{
|
{
|
||||||
|
|
@ -17,7 +20,16 @@ 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 SIMPLSHARP
|
||||||
|
if (IcdEnvironment.RuntimeEnvironment == IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono)
|
||||||
|
return IcdDirectory.GetApplicationRootDirectory();
|
||||||
|
#endif
|
||||||
|
return IcdDirectory.GetDirectoryRoot(IcdPath.DirectorySeparatorChar.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the path to the program directory
|
/// Gets the path to the program directory
|
||||||
|
|
@ -35,7 +47,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 +65,12 @@ namespace ICD.Common.Utils
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
#if SIMPLSHARP
|
||||||
|
if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Server)
|
||||||
|
{
|
||||||
|
return Join(RootConfigPath, "ProgramConfig");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
@ -62,7 +80,12 @@ namespace ICD.Common.Utils
|
||||||
/// Returns the absolute path to the common configuration directory.
|
/// Returns the absolute path to the common configuration directory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public static string CommonConfigPath { get { return Join(RootConfigPath, "CommonConfig"); } }
|
public static string CommonConfigPath {
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Join(RootConfigPath, "CommonConfig");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the absolute path to the common config library directory.
|
/// Returns the absolute path to the common config library directory.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue