fix: update target frameworks and package references; change culture to InvariantCulture

This commit is contained in:
jtalborough 2025-02-25 19:17:34 -05:00 committed by Neil Dorin
parent dbab427d69
commit 8be5481ac9
29 changed files with 160 additions and 64 deletions

View file

@ -1,7 +1,12 @@
using System;
extern alias NewtonsoftJson;
using System;
using Crestron.SimplSharp;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using JsonConverter = NewtonsoftJson::Newtonsoft.Json.JsonConverterAttribute;
using JsonIgnore = NewtonsoftJson::Newtonsoft.Json.JsonIgnoreAttribute;
using JsonProperty = NewtonsoftJson::Newtonsoft.Json.JsonPropertyAttribute;
using NullValueHandling = NewtonsoftJson::Newtonsoft.Json.NullValueHandling;
using StringEnumConverter = NewtonsoftJson::Newtonsoft.Json.Converters.StringEnumConverter;
namespace PepperDash.Core
{

View file

@ -1,10 +1,13 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronSockets;
using Newtonsoft.Json;
using JsonProperty = NewtonsoftJson::Newtonsoft.Json.JsonPropertyAttribute;
using Required = NewtonsoftJson::Newtonsoft.Json.Required;
namespace PepperDash.Core
{

View file

@ -1,12 +1,15 @@

extern alias NewtonsoftJson;
using System;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronSockets;
using Newtonsoft.Json;
using JsonProperty = NewtonsoftJson::Newtonsoft.Json.JsonPropertyAttribute;
using PepperDash.Core.Logging;
using Required = NewtonsoftJson::Newtonsoft.Json.Required;
namespace PepperDash.Core
{

View file

@ -1,4 +1,6 @@
using Newtonsoft.Json;
extern alias NewtonsoftJson;
using JsonProperty = NewtonsoftJson::Newtonsoft.Json.JsonPropertyAttribute;
namespace PepperDash.Core
{

View file

@ -1,8 +1,12 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronSockets;
using Newtonsoft.Json;
using JsonConverter = NewtonsoftJson::Newtonsoft.Json.JsonConverterAttribute;
using JsonProperty = NewtonsoftJson::Newtonsoft.Json.JsonPropertyAttribute;
using StringEnumConverter = NewtonsoftJson::Newtonsoft.Json.Converters.StringEnumConverter;
namespace PepperDash.Core
{
@ -88,7 +92,7 @@ namespace PepperDash.Core
/// The current socket status of the client
/// </summary>
[JsonProperty("clientStatus")]
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
[JsonConverter(typeof(StringEnumConverter))]
SocketStatus ClientStatus { get; }
}

View file

@ -1,12 +1,18 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Formatting = NewtonsoftJson::Newtonsoft.Json.Formatting;
using JArray = NewtonsoftJson::Newtonsoft.Json.Linq.JArray;
using JObject = NewtonsoftJson::Newtonsoft.Json.Linq.JObject;
using JToken = NewtonsoftJson::Newtonsoft.Json.Linq.JToken;
using PepperDash.Core;
using Serilog.Events;
namespace PepperDash.Core.Config
{
@ -56,12 +62,12 @@ namespace PepperDash.Core.Config
var merged = MergeConfigs(jsonObj);
if (jsonObj[systemUrl] != null)
{
merged[systemUrl] = jsonObj[systemUrl].Value<string>();
merged[systemUrl] = (string)jsonObj[systemUrl];
}
if (jsonObj[templateUrl] != null)
{
merged[templateUrl] = jsonObj[templateUrl].Value<string>();
merged[templateUrl] = (string)jsonObj[templateUrl];
}
jsonObj = merged;

View file

@ -1,9 +1,11 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Newtonsoft.Json;
using JsonProperty = NewtonsoftJson::Newtonsoft.Json.JsonPropertyAttribute;
using Serilog;
namespace PepperDash.Core

View file

@ -1,5 +1,7 @@
using Crestron.SimplSharp;
using Newtonsoft.Json;
extern alias NewtonsoftJson;
using Crestron.SimplSharp;
using JsonProperty = NewtonsoftJson::Newtonsoft.Json.JsonPropertyAttribute;
using Serilog.Events;
namespace PepperDash.Core

View file

@ -1,6 +1,8 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Linq;
using Newtonsoft.Json.Linq;
using JArray = NewtonsoftJson::Newtonsoft.Json.Linq.JArray;
using Serilog.Events;
namespace PepperDash.Core.JsonToSimpl
@ -129,7 +131,7 @@ namespace PepperDash.Core.JsonToSimpl
var item = array.FirstOrDefault(o =>
{
var prop = o[SearchPropertyName];
return prop != null && prop.Value<string>()
return prop != null && ((string)prop)
.Equals(SearchPropertyValue, StringComparison.OrdinalIgnoreCase);
});
if (item == null)

View file

@ -1,7 +1,9 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
using JValue = NewtonsoftJson::Newtonsoft.Json.Linq.JValue;
namespace PepperDash.Core.JsonToSimpl
{
@ -233,7 +235,7 @@ namespace PepperDash.Core.JsonToSimpl
if (isCount)
response = (t.HasValues ? t.Children().Count() : 0).ToString();
else
response = t.Value<string>();
response = (string)t;
Debug.Console(1, " ='{0}'", response);
return true;
}

View file

@ -1,11 +1,15 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json.Linq;
using Formatting = NewtonsoftJson::Newtonsoft.Json.Formatting;
using JObject = NewtonsoftJson::Newtonsoft.Json.Linq.JObject;
using JValue = NewtonsoftJson::Newtonsoft.Json.Linq.JValue;
namespace PepperDash.Core.JsonToSimpl
{

View file

@ -1,7 +1,10 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Newtonsoft.Json.Linq;
using JObject = NewtonsoftJson::Newtonsoft.Json.Linq.JObject;
using JValue = NewtonsoftJson::Newtonsoft.Json.Linq.JValue;
namespace PepperDash.Core.JsonToSimpl
{

View file

@ -1,10 +1,15 @@
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using System.IO;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using JArray = NewtonsoftJson::Newtonsoft.Json.Linq.JArray;
using JObject = NewtonsoftJson::Newtonsoft.Json.Linq.JObject;
using JValue = NewtonsoftJson::Newtonsoft.Json.Linq.JValue;
using JsonSerializationException = NewtonsoftJson::Newtonsoft.Json.JsonSerializationException;
using JsonTextReader = NewtonsoftJson::Newtonsoft.Json.JsonTextReader;
namespace PepperDash.Core.JsonToSimpl
{
@ -165,7 +170,7 @@ namespace PepperDash.Core.JsonToSimpl
#if NET6_0
using (var reader = new JsonTextReader(new System.IO.StringReader(json)))
#else
using (var reader = new JsonTextReader(new Crestron.SimplSharp.CrestronIO.StringReader(json)))
using (var reader = new JsonTextReader(new System.IO.StringReader(json)))
#endif
{
var startDepth = reader.Depth;
@ -189,7 +194,7 @@ namespace PepperDash.Core.JsonToSimpl
#if NET6_0
using (var reader = new JsonTextReader(new System.IO.StringReader(json)))
#else
using (var reader = new JsonTextReader(new Crestron.SimplSharp.CrestronIO.StringReader(json)))
using (var reader = new JsonTextReader(new System.IO.StringReader(json)))
#endif
{
var startDepth = reader.Depth;

View file

@ -1,9 +1,12 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json.Linq;
using JObject = NewtonsoftJson::Newtonsoft.Json.Linq.JObject;
using JValue = NewtonsoftJson::Newtonsoft.Json.Linq.JValue;
using PepperDash.Core.Config;
namespace PepperDash.Core.JsonToSimpl

View file

@ -1,4 +1,6 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using System.Net;
using System.Reflection;
@ -7,7 +9,8 @@ using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronDataStore;
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharp.CrestronLogger;
using Newtonsoft.Json;
using Formatting = NewtonsoftJson::Newtonsoft.Json.Formatting;
using JsonConvert = NewtonsoftJson::Newtonsoft.Json.JsonConvert;
using PepperDash.Core.Logging;
using Serilog;
using Serilog.Context;

View file

@ -1,9 +1,12 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json;
using Formatting = NewtonsoftJson::Newtonsoft.Json.Formatting;
using JsonConvert = NewtonsoftJson::Newtonsoft.Json.JsonConvert;
namespace PepperDash.Core

View file

@ -1,6 +1,8 @@
using System.Collections.Generic;
extern alias NewtonsoftJson;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Newtonsoft.Json;
using JsonProperty = NewtonsoftJson::Newtonsoft.Json.JsonPropertyAttribute;
namespace PepperDash.Core.Logging
{

View file

@ -1,4 +1,6 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -16,7 +18,7 @@ using X509Certificate2 = System.Security.Cryptography.X509Certificates.X509Certi
using System.IO;
using Org.BouncyCastle.Asn1.X509;
using Serilog.Formatting;
using Newtonsoft.Json.Linq;
using JObject = NewtonsoftJson::Newtonsoft.Json.Linq.JObject;
using Serilog.Formatting.Json;
namespace PepperDash.Core

View file

@ -44,6 +44,9 @@
<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="Crestron.SimplSharp.SDK.Library" Version="2.21.90" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4">
<Aliases>global,NewtonsoftJson</Aliases>
</PackageReference>
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Expressions" Version="4.0.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="2.0.0" />
@ -53,7 +56,9 @@
<PackageReference Include="WebSocketSharp" Version="1.0.3-rc11" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3">
<Aliases>global,NewtonsoftJson</Aliases>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Remove="Comm\._GenericSshClient.cs" />

View file

@ -1,10 +1,13 @@
using System;
extern alias NewtonsoftJson;
using System;
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharp.WebScripting;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Formatting = NewtonsoftJson::Newtonsoft.Json.Formatting;
using JsonConvert = NewtonsoftJson::Newtonsoft.Json.JsonConvert;
using JObject = NewtonsoftJson::Newtonsoft.Json.Linq.JObject;
using PepperDash.Core.Web.RequestHandlers;
namespace PepperDash.Core.Web

View file

@ -1,10 +1,12 @@
using System;
extern alias NewtonsoftJson;
using System;
using Crestron.SimplSharp; // For Basic SIMPL# Classes
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharp.Net.Http;
using Crestron.SimplSharp.Net.Https;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using JsonConvert = NewtonsoftJson::Newtonsoft.Json.JsonConvert;
using JObject = NewtonsoftJson::Newtonsoft.Json.Linq.JObject;
using PepperDash.Core.JsonToSimpl;