mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
feat: Adding SimplSharpMono environment (for non-pro 4-series environment)
fix: Fix error in console FixLineEndings
This commit is contained in:
committed by
Chris Cameron
parent
3abb792c5c
commit
68365553ed
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
- Added eDaysOfWeek flags enum
|
||||
- Added support for reading the primitive type double to IcdXmlReader and XmlUtils
|
||||
- Added ProcessorUtils.GetSystemStartTime() to get DateTime the system started instead of a TimeSpan
|
||||
- Added SimplSharpMono environment to IcdEnvironment, for non-pro 4-series environment
|
||||
|
||||
### Changed
|
||||
- Repeater changed to use configured callbacks instead of a dumb event
|
||||
|
||||
@@ -203,7 +203,8 @@ namespace ICD.Common.Utils
|
||||
/// <returns></returns>
|
||||
private static string FixLineEndings(string input)
|
||||
{
|
||||
if (IcdEnvironment.RuntimeEnvironment != IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono)
|
||||
if (IcdEnvironment.RuntimeEnvironment != IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono
|
||||
&& IcdEnvironment.RuntimeEnvironment != IcdEnvironment.eRuntimeEnvironment.SimplSharpMono)
|
||||
return input;
|
||||
|
||||
return s_NewLineRegex.Replace(input, NEWLINE);
|
||||
|
||||
@@ -200,9 +200,7 @@ namespace ICD.Common.Utils
|
||||
s_RuntimeEnvironment =
|
||||
CrestronEnvironment.DevicePlatform == eDevicePlatform.Server
|
||||
? eRuntimeEnvironment.SimplSharpProServer
|
||||
: Type.GetType("Mono.Runtime") == null
|
||||
? GetRuntimeEnvironment(CrestronEnvironment.RuntimeEnvironment)
|
||||
: eRuntimeEnvironment.SimplSharpProMono;
|
||||
: GetRuntimeEnvironment(CrestronEnvironment.RuntimeEnvironment, Type.GetType("Mono.Runtime") != null);
|
||||
|
||||
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironmentOnProgramStatusEventHandler;
|
||||
CrestronEnvironment.EthernetEventHandler += CrestronEnvironmentOnEthernetEventHandler;
|
||||
@@ -260,14 +258,14 @@ namespace ICD.Common.Utils
|
||||
}
|
||||
}
|
||||
|
||||
private static eRuntimeEnvironment GetRuntimeEnvironment(Crestron.SimplSharp.eRuntimeEnvironment runtimeEnvironment)
|
||||
private static eRuntimeEnvironment GetRuntimeEnvironment(Crestron.SimplSharp.eRuntimeEnvironment runtimeEnvironment, bool mono)
|
||||
{
|
||||
switch (runtimeEnvironment)
|
||||
{
|
||||
case Crestron.SimplSharp.eRuntimeEnvironment.SIMPL:
|
||||
return eRuntimeEnvironment.SimplSharp;
|
||||
return mono ? eRuntimeEnvironment.SimplSharpMono : eRuntimeEnvironment.SimplSharp;
|
||||
case Crestron.SimplSharp.eRuntimeEnvironment.SimplSharpPro:
|
||||
return eRuntimeEnvironment.SimplSharpPro;
|
||||
return mono ? eRuntimeEnvironment.SimplSharpProMono : eRuntimeEnvironment.SimplSharpPro;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("runtimeEnvironment");
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace ICD.Common.Utils
|
||||
public enum eRuntimeEnvironment
|
||||
{
|
||||
SimplSharp,
|
||||
SimplSharpMono,
|
||||
SimplSharpPro,
|
||||
SimplSharpProMono,
|
||||
SimplSharpProServer,
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace ICD.Common.Utils
|
||||
#if SIMPLSHARP
|
||||
switch (IcdEnvironment.RuntimeEnvironment)
|
||||
{
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||
return Join(RootPath, "user");
|
||||
default:
|
||||
@@ -96,6 +97,7 @@ namespace ICD.Common.Utils
|
||||
switch (IcdEnvironment.RuntimeEnvironment)
|
||||
{
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||
case IcdEnvironment.eRuntimeEnvironment.Standard:
|
||||
@@ -128,6 +130,7 @@ namespace ICD.Common.Utils
|
||||
switch (IcdEnvironment.RuntimeEnvironment)
|
||||
{
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||
case IcdEnvironment.eRuntimeEnvironment.Standard:
|
||||
@@ -177,6 +180,7 @@ namespace ICD.Common.Utils
|
||||
switch (IcdEnvironment.RuntimeEnvironment)
|
||||
{
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||
case IcdEnvironment.eRuntimeEnvironment.Standard:
|
||||
@@ -210,6 +214,7 @@ namespace ICD.Common.Utils
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
||||
return Join(RootPath, "HTML");
|
||||
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||
return Join(RootPath, "html");
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ namespace ICD.Common.Utils
|
||||
{
|
||||
switch (IcdEnvironment.RuntimeEnvironment)
|
||||
{
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||
date = StringUtils.RemoveDuplicateWhitespace(date);
|
||||
return DateTime.ParseExact(date, "MMM d yyyy", CultureInfo.InvariantCulture).ToUniversalTime();
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace ICD.Common.Utils
|
||||
switch (IcdEnvironment.RuntimeEnvironment)
|
||||
{
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||
int length = Math.Min(13, name.Length);
|
||||
name = name.Substring(0, length).PadRight(13);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user