mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +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 eDaysOfWeek flags enum
|
||||||
- Added support for reading the primitive type double to IcdXmlReader and XmlUtils
|
- 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 ProcessorUtils.GetSystemStartTime() to get DateTime the system started instead of a TimeSpan
|
||||||
|
- Added SimplSharpMono environment to IcdEnvironment, for non-pro 4-series environment
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Repeater changed to use configured callbacks instead of a dumb event
|
- Repeater changed to use configured callbacks instead of a dumb event
|
||||||
|
|||||||
@@ -203,7 +203,8 @@ namespace ICD.Common.Utils
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static string FixLineEndings(string input)
|
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 input;
|
||||||
|
|
||||||
return s_NewLineRegex.Replace(input, NEWLINE);
|
return s_NewLineRegex.Replace(input, NEWLINE);
|
||||||
|
|||||||
@@ -200,9 +200,7 @@ namespace ICD.Common.Utils
|
|||||||
s_RuntimeEnvironment =
|
s_RuntimeEnvironment =
|
||||||
CrestronEnvironment.DevicePlatform == eDevicePlatform.Server
|
CrestronEnvironment.DevicePlatform == eDevicePlatform.Server
|
||||||
? eRuntimeEnvironment.SimplSharpProServer
|
? eRuntimeEnvironment.SimplSharpProServer
|
||||||
: Type.GetType("Mono.Runtime") == null
|
: GetRuntimeEnvironment(CrestronEnvironment.RuntimeEnvironment, Type.GetType("Mono.Runtime") != null);
|
||||||
? GetRuntimeEnvironment(CrestronEnvironment.RuntimeEnvironment)
|
|
||||||
: eRuntimeEnvironment.SimplSharpProMono;
|
|
||||||
|
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironmentOnProgramStatusEventHandler;
|
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironmentOnProgramStatusEventHandler;
|
||||||
CrestronEnvironment.EthernetEventHandler += CrestronEnvironmentOnEthernetEventHandler;
|
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)
|
switch (runtimeEnvironment)
|
||||||
{
|
{
|
||||||
case Crestron.SimplSharp.eRuntimeEnvironment.SIMPL:
|
case Crestron.SimplSharp.eRuntimeEnvironment.SIMPL:
|
||||||
return eRuntimeEnvironment.SimplSharp;
|
return mono ? eRuntimeEnvironment.SimplSharpMono : eRuntimeEnvironment.SimplSharp;
|
||||||
case Crestron.SimplSharp.eRuntimeEnvironment.SimplSharpPro:
|
case Crestron.SimplSharp.eRuntimeEnvironment.SimplSharpPro:
|
||||||
return eRuntimeEnvironment.SimplSharpPro;
|
return mono ? eRuntimeEnvironment.SimplSharpProMono : eRuntimeEnvironment.SimplSharpPro;
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException("runtimeEnvironment");
|
throw new ArgumentOutOfRangeException("runtimeEnvironment");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ namespace ICD.Common.Utils
|
|||||||
public enum eRuntimeEnvironment
|
public enum eRuntimeEnvironment
|
||||||
{
|
{
|
||||||
SimplSharp,
|
SimplSharp,
|
||||||
|
SimplSharpMono,
|
||||||
SimplSharpPro,
|
SimplSharpPro,
|
||||||
SimplSharpProMono,
|
SimplSharpProMono,
|
||||||
SimplSharpProServer,
|
SimplSharpProServer,
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ namespace ICD.Common.Utils
|
|||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
switch (IcdEnvironment.RuntimeEnvironment)
|
switch (IcdEnvironment.RuntimeEnvironment)
|
||||||
{
|
{
|
||||||
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||||
return Join(RootPath, "user");
|
return Join(RootPath, "user");
|
||||||
default:
|
default:
|
||||||
@@ -96,6 +97,7 @@ namespace ICD.Common.Utils
|
|||||||
switch (IcdEnvironment.RuntimeEnvironment)
|
switch (IcdEnvironment.RuntimeEnvironment)
|
||||||
{
|
{
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
||||||
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.Standard:
|
case IcdEnvironment.eRuntimeEnvironment.Standard:
|
||||||
@@ -128,6 +130,7 @@ namespace ICD.Common.Utils
|
|||||||
switch (IcdEnvironment.RuntimeEnvironment)
|
switch (IcdEnvironment.RuntimeEnvironment)
|
||||||
{
|
{
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
||||||
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.Standard:
|
case IcdEnvironment.eRuntimeEnvironment.Standard:
|
||||||
@@ -177,6 +180,7 @@ namespace ICD.Common.Utils
|
|||||||
switch (IcdEnvironment.RuntimeEnvironment)
|
switch (IcdEnvironment.RuntimeEnvironment)
|
||||||
{
|
{
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
||||||
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.Standard:
|
case IcdEnvironment.eRuntimeEnvironment.Standard:
|
||||||
@@ -210,6 +214,7 @@ namespace ICD.Common.Utils
|
|||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpPro:
|
||||||
return Join(RootPath, "HTML");
|
return Join(RootPath, "HTML");
|
||||||
|
|
||||||
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||||
return Join(RootPath, "html");
|
return Join(RootPath, "html");
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ namespace ICD.Common.Utils
|
|||||||
{
|
{
|
||||||
switch (IcdEnvironment.RuntimeEnvironment)
|
switch (IcdEnvironment.RuntimeEnvironment)
|
||||||
{
|
{
|
||||||
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpProMono:
|
||||||
date = StringUtils.RemoveDuplicateWhitespace(date);
|
date = StringUtils.RemoveDuplicateWhitespace(date);
|
||||||
return DateTime.ParseExact(date, "MMM d yyyy", CultureInfo.InvariantCulture).ToUniversalTime();
|
return DateTime.ParseExact(date, "MMM d yyyy", CultureInfo.InvariantCulture).ToUniversalTime();
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ namespace ICD.Common.Utils
|
|||||||
switch (IcdEnvironment.RuntimeEnvironment)
|
switch (IcdEnvironment.RuntimeEnvironment)
|
||||||
{
|
{
|
||||||
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharp:
|
||||||
|
case IcdEnvironment.eRuntimeEnvironment.SimplSharpMono:
|
||||||
int length = Math.Min(13, name.Length);
|
int length = Math.Min(13, name.Length);
|
||||||
name = name.Substring(0, length).PadRight(13);
|
name = name.Substring(0, length).PadRight(13);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user