style: run code cleanup & apply VS suggestions

This commit is contained in:
Andrew Welker
2025-03-25 22:14:15 -05:00
parent 4d98191fa7
commit 789111cb9a
64 changed files with 329 additions and 390 deletions

View File

@@ -1,7 +1,6 @@
using Crestron.SimplSharp.WebScripting;
using Newtonsoft.Json;
using PepperDash.Core.Web.RequestHandlers;
using PepperDash.Essentials.AppServer.Messengers;
using System.Collections.Generic;
using System.Linq;
@@ -33,7 +32,7 @@ namespace PepperDash.Essentials.WebApiHandlers
private readonly MobileControlSystemController mcController;
[JsonProperty("actionPaths")]
public List<ActionPath> ActionPaths => mcController.GetActionDictionaryPaths().Select((path) => new ActionPath { MessengerKey = path.Item1, Path = path.Item2}).ToList();
public List<ActionPath> ActionPaths => mcController.GetActionDictionaryPaths().Select((path) => new ActionPath { MessengerKey = path.Item1, Path = path.Item2 }).ToList();
public ActionPathsResponse(MobileControlSystemController mcController)
{

View File

@@ -3,6 +3,7 @@ using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Core.Web.RequestHandlers;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.WebSocketServer;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -30,8 +31,7 @@ namespace PepperDash.Essentials.WebApiHandlers
}
catch (Exception ex)
{
Debug.Console(1, $"exception showing mobile info: {ex.Message}");
Debug.Console(2, $"stack trace: {ex.StackTrace}");
Debug.LogMessage(ex, "exception showing mobile info");
context.Response.StatusCode = 500;
context.Response.End();
@@ -143,7 +143,7 @@ namespace PepperDash.Essentials.WebApiHandlers
public string Token => Key;
[JsonProperty("connected")]
public bool Connected => context.Client == null ? false : context.Client.Context.WebSocket.IsAlive;
public bool Connected => context.Client != null && context.Client.Context.WebSocket.IsAlive;
[JsonProperty("duration")]
public double Duration => context.Client == null ? 0 : context.Client.ConnectedDuration.TotalSeconds;

View File

@@ -3,6 +3,7 @@ using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Core.Web.RequestHandlers;
using PepperDash.Essentials.Core.Web;
using PepperDash.Essentials.WebSocketServer;
using Serilog.Events;
namespace PepperDash.Essentials.WebApiHandlers