docs: fix CS1587 errors

This commit is contained in:
Andrew Welker
2025-09-17 08:52:44 -05:00
parent 6d61c4525e
commit 4ca1031bef
6 changed files with 374 additions and 368 deletions

View File

@@ -2,14 +2,12 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using System.Reflection;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.EthernetCommunication;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
using Serilog.Events;
@@ -355,22 +353,22 @@ namespace PepperDash.Essentials.Core.Bridges
/// </summary>
public class EiscApiPropertiesConfig
{
[JsonProperty("control")]
/// <summary>
/// Gets or sets the Control
/// </summary>
[JsonProperty("control")]
public EssentialsControlPropertiesConfig Control { get; set; }
[JsonProperty("devices")]
/// <summary>
/// Gets or sets the Devices
/// </summary>
[JsonProperty("devices")]
public List<ApiDevicePropertiesConfig> Devices { get; set; }
[JsonProperty("rooms")]
/// <summary>
/// Gets or sets the Rooms
/// </summary>
[JsonProperty("rooms")]
public List<ApiRoomPropertiesConfig> Rooms { get; set; }
@@ -379,22 +377,22 @@ namespace PepperDash.Essentials.Core.Bridges
/// </summary>
public class ApiDevicePropertiesConfig
{
[JsonProperty("deviceKey")]
/// <summary>
/// Gets or sets the DeviceKey
/// </summary>
[JsonProperty("deviceKey")]
public string DeviceKey { get; set; }
[JsonProperty("joinStart")]
/// <summary>
/// Gets or sets the JoinStart
/// </summary>
[JsonProperty("joinStart")]
public uint JoinStart { get; set; }
[JsonProperty("joinMapKey")]
/// <summary>
/// Gets or sets the JoinMapKey
/// </summary>
[JsonProperty("joinMapKey")]
public string JoinMapKey { get; set; }
}
@@ -403,22 +401,22 @@ namespace PepperDash.Essentials.Core.Bridges
/// </summary>
public class ApiRoomPropertiesConfig
{
[JsonProperty("roomKey")]
/// <summary>
/// Gets or sets the RoomKey
/// </summary>
[JsonProperty("roomKey")]
public string RoomKey { get; set; }
[JsonProperty("joinStart")]
/// <summary>
/// Gets or sets the JoinStart
/// </summary>
[JsonProperty("joinStart")]
public uint JoinStart { get; set; }
[JsonProperty("joinMapKey")]
/// <summary>
/// Gets or sets the JoinMapKey
/// </summary>
[JsonProperty("joinMapKey")]
public string JoinMapKey { get; set; }
}

View File

@@ -18,41 +18,41 @@ namespace PepperDash.Essentials.Core.Config
/// </summary>
public class DeviceConfig
{
[JsonProperty("key")]
/// <summary>
/// Gets or sets the Key
/// </summary>
[JsonProperty("key")]
public string Key { get; set; }
[JsonProperty("uid")]
/// <summary>
/// Gets or sets the Uid
/// </summary>
[JsonProperty("uid")]
public int Uid { get; set; }
[JsonProperty("name")]
/// <summary>
/// Gets or sets the Name
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("group")]
/// <summary>
/// Gets or sets the Group
/// </summary>
[JsonProperty("group")]
public string Group { get; set; }
[JsonProperty("type")]
/// <summary>
/// Gets or sets the Type
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
[JsonProperty("properties")]
[JsonConverter(typeof(DevicePropertiesConverter))]
/// <summary>
/// Gets or sets the Properties
/// </summary>
[JsonProperty("properties")]
[JsonConverter(typeof(DevicePropertiesConverter))]
public JToken Properties { get; set; }
public DeviceConfig(DeviceConfig dc)
@@ -68,7 +68,7 @@ namespace PepperDash.Essentials.Core.Config
//Properties = JToken.FromObject(dc.Properties);
}
public DeviceConfig() {}
public DeviceConfig() { }
}
/// <summary>

View File

@@ -1,14 +1,14 @@
using System;
using System.Linq;
using Crestron.SimplSharp;
using PepperDash.Core;
using Serilog.Events;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Defines the contract for IHasFeedback
/// </summary>
/// <summary>
/// Defines the contract for IHasFeedback
/// </summary>
public interface IHasFeedback : IKeyed
{
/// <summary>
@@ -19,47 +19,55 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// Extension methods for IHasFeedback
/// </summary>
public static class IHasFeedbackExtensions
{
/// <summary>
/// Dumps the feedbacks to the console
/// </summary>
/// <param name="source"></param>
/// <param name="getCurrentStates"></param>
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
{
Type t = source.GetType();
// get the properties and set them into a new collection of NameType wrappers
var props = t.GetProperties().Select(p => new PropertyNameType(p, t));
Type t = source.GetType();
// get the properties and set them into a new collection of NameType wrappers
var props = t.GetProperties().Select(p => new PropertyNameType(p, t));
var feedbacks = source.Feedbacks;
if (feedbacks != null)
if (feedbacks == null)
{
Debug.LogMessage(LogEventLevel.Information, source, "\n\nAvailable feedbacks:");
foreach (var f in feedbacks)
{
string val = "";
string type = "";
if (getCurrentStates)
{
if (f is BoolFeedback)
{
val = f.BoolValue.ToString();
type = "boolean";
}
else if (f is IntFeedback)
{
val = f.IntValue.ToString();
type = "integer";
}
else if (f is StringFeedback)
{
val = f.StringValue;
type = "string";
}
}
Debug.LogMessage(LogEventLevel.Information, "{0,-12} {1, -25} {2}", type,
(string.IsNullOrEmpty(f.Key) ? "-no key-" : f.Key), val);
}
CrestronConsole.ConsoleCommandResponse("No available outputs\r\n");
return;
}
CrestronConsole.ConsoleCommandResponse("Available feedbacks:\r\n");
foreach (var f in feedbacks)
{
string val = "";
string type = "";
if (getCurrentStates)
{
if (f is BoolFeedback)
{
val = f.BoolValue.ToString();
type = "boolean";
}
else if (f is IntFeedback)
{
val = f.IntValue.ToString();
type = "integer";
}
else if (f is StringFeedback)
{
val = f.StringValue;
type = "string";
}
}
CrestronConsole.ConsoleCommandResponse($"{type,-12} {(string.IsNullOrEmpty(f.Key) ? "-no key-" : f.Key),-25} {val}\r\n");
}
else
Debug.LogMessage(LogEventLevel.Information, source, "No available outputs:");
}
}
}

View File

@@ -9,11 +9,11 @@ using Serilog.Events;
namespace PepperDash.Essentials.Room.Config
{
/// <summary>
/// Represents a EssentialsRoomConfigHelper
/// </summary>
public class EssentialsRoomConfigHelper
{
/// <summary>
/// Represents a EssentialsRoomConfigHelper
/// </summary>
public class EssentialsRoomConfigHelper
{
/// <summary>
/// GetEmergency method
/// </summary>
@@ -31,100 +31,100 @@ namespace PepperDash.Essentials.Room.Config
return null;
}
/// <summary>
///
/// </summary>
/// <param name="props"></param>
/// <param name="room"></param>
/// <returns></returns>
/// <summary>
/// GetMicrophonePrivacy method
/// </summary>
public static MicrophonePrivacyController GetMicrophonePrivacy(
EssentialsRoomPropertiesConfig props, IPrivacy room)
{
var microphonePrivacy = props.MicrophonePrivacy;
if (microphonePrivacy == null)
{
Debug.LogMessage(LogEventLevel.Information, "Cannot create microphone privacy with null properties");
return null;
}
// Get the MicrophonePrivacy device from the device manager
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as MicrophonePrivacyController);
// Set this room as the IPrivacy device
if (mP == null)
{
Debug.LogMessage(LogEventLevel.Information, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
return null;
}
mP.SetPrivacyDevice(room);
/// <summary>
///
/// </summary>
/// <param name="props"></param>
/// <param name="room"></param>
/// <returns></returns>
/// <summary>
/// GetMicrophonePrivacy method
/// </summary>
public static MicrophonePrivacyController GetMicrophonePrivacy(
EssentialsRoomPropertiesConfig props, IPrivacy room)
{
var microphonePrivacy = props.MicrophonePrivacy;
if (microphonePrivacy == null)
{
Debug.LogMessage(LogEventLevel.Information, "Cannot create microphone privacy with null properties");
return null;
}
// Get the MicrophonePrivacy device from the device manager
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as MicrophonePrivacyController);
// Set this room as the IPrivacy device
if (mP == null)
{
Debug.LogMessage(LogEventLevel.Information, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
return null;
}
mP.SetPrivacyDevice(room);
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
if (behaviour == null)
{
Debug.LogMessage(LogEventLevel.Information, "WARNING: No behaviour defined for MicrophonePrivacyController");
return null;
}
if (behaviour == "trackroomstate")
{
// Tie LED enable to room power state
if (behaviour == null)
{
Debug.LogMessage(LogEventLevel.Information, "WARNING: No behaviour defined for MicrophonePrivacyController");
return null;
}
if (behaviour == "trackroomstate")
{
// Tie LED enable to room power state
var essRoom = room as IEssentialsRoom;
essRoom.OnFeedback.OutputChange += (o, a) =>
{
{
if (essRoom.OnFeedback.BoolValue)
mP.EnableLeds = true;
else
mP.EnableLeds = false;
};
mP.EnableLeds = true;
else
mP.EnableLeds = false;
};
mP.EnableLeds = essRoom.OnFeedback.BoolValue;
}
else if (behaviour == "trackcallstate")
{
// Tie LED enable to room power state
}
else if (behaviour == "trackcallstate")
{
// Tie LED enable to room power state
var inCallRoom = room as IHasInCallFeedback;
inCallRoom.InCallFeedback.OutputChange += (o, a) =>
{
{
if (inCallRoom.InCallFeedback.BoolValue)
mP.EnableLeds = true;
else
mP.EnableLeds = false;
};
mP.EnableLeds = true;
else
mP.EnableLeds = false;
};
mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue;
}
}
return mP;
}
}
return mP;
}
/// <summary>
/// Represents a EssentialsRoomPropertiesConfig
/// </summary>
public class EssentialsRoomPropertiesConfig
{
[JsonProperty("addresses")]
public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
}
[JsonProperty("description")]
public string Description { get; set; }
/// <summary>
/// Represents a EssentialsRoomPropertiesConfig
/// </summary>
public class EssentialsRoomPropertiesConfig
{
[JsonProperty("addresses")]
public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
[JsonProperty("emergency")]
public EssentialsRoomEmergencyConfig Emergency { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("help")]
/// <summary>
/// Gets or sets the Help
/// </summary>
public EssentialsHelpPropertiesConfig Help { get; set; }
[JsonProperty("emergency")]
public EssentialsRoomEmergencyConfig Emergency { get; set; }
[JsonProperty("helpMessage")]
/// <summary>
/// Gets or sets the HelpMessage
/// </summary>
public string HelpMessage { get; set; }
/// <summary>
/// Gets or sets the Help
/// </summary>
[JsonProperty("help")]
public EssentialsHelpPropertiesConfig Help { get; set; }
/// <summary>
/// Gets or sets the HelpMessage
/// </summary>
[JsonProperty("helpMessage")]
public string HelpMessage { get; set; }
/// <summary>
/// Read this value to get the help message. It checks for the old and new config format.
@@ -133,94 +133,94 @@ namespace PepperDash.Essentials.Room.Config
{
get
{
if(Help != null && !string.IsNullOrEmpty(Help.Message))
if (Help != null && !string.IsNullOrEmpty(Help.Message))
{
return Help.Message;
}
else
{
return HelpMessage;
return HelpMessage;
}
}
}
[JsonProperty("environment")]
/// <summary>
/// Gets or sets the Environment
/// </summary>
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
/// <summary>
/// Gets or sets the Environment
/// </summary>
[JsonProperty("environment")]
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
[JsonProperty("logo")]
/// <summary>
/// Gets or sets the LogoLight
/// </summary>
public EssentialsLogoPropertiesConfig LogoLight { get; set; }
/// <summary>
/// Gets or sets the LogoLight
/// </summary>
[JsonProperty("logo")]
public EssentialsLogoPropertiesConfig LogoLight { get; set; }
[JsonProperty("logoDark")]
/// <summary>
/// Gets or sets the LogoDark
/// </summary>
[JsonProperty("logoDark")]
public EssentialsLogoPropertiesConfig LogoDark { get; set; }
[JsonProperty("microphonePrivacy")]
/// <summary>
/// Gets or sets the MicrophonePrivacy
/// </summary>
public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
[JsonProperty("occupancy")]
/// <summary>
/// Gets or sets the Occupancy
/// </summary>
public EssentialsRoomOccSensorConfig Occupancy { get; set; }
/// <summary>
/// Gets or sets the MicrophonePrivacy
/// </summary>
[JsonProperty("microphonePrivacy")]
public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
[JsonProperty("oneButtonMeeting")]
/// <summary>
/// Gets or sets the OneButtonMeeting
/// </summary>
public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; }
/// <summary>
/// Gets or sets the Occupancy
/// </summary>
[JsonProperty("occupancy")]
public EssentialsRoomOccSensorConfig Occupancy { get; set; }
[JsonProperty("shutdownVacancySeconds")]
/// <summary>
/// Gets or sets the ShutdownVacancySeconds
/// </summary>
public int ShutdownVacancySeconds { get; set; }
/// <summary>
/// Gets or sets the OneButtonMeeting
/// </summary>
[JsonProperty("oneButtonMeeting")]
public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; }
[JsonProperty("shutdownPromptSeconds")]
/// <summary>
/// Gets or sets the ShutdownPromptSeconds
/// </summary>
public int ShutdownPromptSeconds { get; set; }
/// <summary>
/// Gets or sets the ShutdownVacancySeconds
/// </summary>
[JsonProperty("shutdownVacancySeconds")]
public int ShutdownVacancySeconds { get; set; }
[JsonProperty("tech")]
/// <summary>
/// Gets or sets the Tech
/// </summary>
public EssentialsRoomTechConfig Tech { get; set; }
/// <summary>
/// Gets or sets the ShutdownPromptSeconds
/// </summary>
[JsonProperty("shutdownPromptSeconds")]
public int ShutdownPromptSeconds { get; set; }
[JsonProperty("volumes")]
/// <summary>
/// Gets or sets the Volumes
/// </summary>
public EssentialsRoomVolumesConfig Volumes { get; set; }
/// <summary>
/// Gets or sets the Tech
/// </summary>
[JsonProperty("tech")]
public EssentialsRoomTechConfig Tech { get; set; }
/// <summary>
/// Gets or sets the Volumes
/// </summary>
[JsonProperty("volumes")]
public EssentialsRoomVolumesConfig Volumes { get; set; }
[JsonProperty("fusion")]
/// <summary>
/// Gets or sets the Fusion
/// </summary>
[JsonProperty("fusion")]
public EssentialsRoomFusionConfig Fusion { get; set; }
[JsonProperty("essentialsRoomUiBehaviorConfig", NullValueHandling=NullValueHandling.Ignore)]
/// <summary>
/// Gets or sets the UiBehavior
/// </summary>
[JsonProperty("essentialsRoomUiBehaviorConfig", NullValueHandling = NullValueHandling.Ignore)]
public EssentialsRoomUiBehaviorConfig UiBehavior { get; set; }
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
/// <summary>
/// Gets or sets the ZeroVolumeWhenSwtichingVolumeDevices
/// </summary>
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
/// <summary>
/// Gets or sets the ZeroVolumeWhenSwtichingVolumeDevices
/// </summary>
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
/// <summary>
/// Indicates if this room represents a combination of other rooms
@@ -236,7 +236,7 @@ namespace PepperDash.Essentials.Room.Config
LogoLight = new EssentialsLogoPropertiesConfig();
LogoDark = new EssentialsLogoPropertiesConfig();
}
}
}
/// <summary>
/// Represents a EssentialsRoomUiBehaviorConfig
@@ -327,15 +327,15 @@ namespace PepperDash.Essentials.Room.Config
}
/// <summary>
/// Represents a EssentialsEnvironmentPropertiesConfig
/// </summary>
public class EssentialsEnvironmentPropertiesConfig
{
/// <summary>
/// Gets or sets the Enabled
/// </summary>
public bool Enabled { get; set; }
/// <summary>
/// Represents a EssentialsEnvironmentPropertiesConfig
/// </summary>
public class EssentialsEnvironmentPropertiesConfig
{
/// <summary>
/// Gets or sets the Enabled
/// </summary>
public bool Enabled { get; set; }
[JsonProperty("deviceKeys")]
/// <summary>
@@ -348,7 +348,7 @@ namespace PepperDash.Essentials.Room.Config
DeviceKeys = new List<string>();
}
}
}
/// <summary>
/// Represents a EssentialsRoomFusionConfig
@@ -359,7 +359,7 @@ namespace PepperDash.Essentials.Room.Config
{
get
{
try
try
{
return Convert.ToUInt32(IpId, 16);
}
@@ -367,7 +367,7 @@ namespace PepperDash.Essentials.Room.Config
{
throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
}
}
}
@@ -390,17 +390,17 @@ namespace PepperDash.Essentials.Room.Config
/// </summary>
public class EssentialsRoomMicrophonePrivacyConfig
{
[JsonProperty("deviceKey")]
/// <summary>
/// Gets or sets the DeviceKey
/// </summary>
public string DeviceKey { get; set; }
[JsonProperty("deviceKey")]
/// <summary>
/// Gets or sets the DeviceKey
/// </summary>
public string DeviceKey { get; set; }
[JsonProperty("behaviour")]
/// <summary>
/// Gets or sets the Behaviour
/// </summary>
public string Behaviour { get; set; }
[JsonProperty("behaviour")]
/// <summary>
/// Gets or sets the Behaviour
/// </summary>
public string Behaviour { get; set; }
}
/// <summary>
@@ -408,23 +408,23 @@ namespace PepperDash.Essentials.Room.Config
/// </summary>
public class EssentialsHelpPropertiesConfig
{
[JsonProperty("message")]
/// <summary>
/// Gets or sets the Message
/// </summary>
public string Message { get; set; }
[JsonProperty("message")]
/// <summary>
/// Gets or sets the Message
/// </summary>
public string Message { get; set; }
[JsonProperty("showCallButton")]
public bool ShowCallButton { get; set; }
/// <summary>
[JsonProperty("showCallButton")]
public bool ShowCallButton { get; set; }
/// <summary>
/// Defaults to "Call Help Desk"
/// </summary>
[JsonProperty("callButtonText")]
/// <summary>
/// Gets or sets the CallButtonText
/// </summary>
public string CallButtonText { get; set; }
[JsonProperty("callButtonText")]
/// <summary>
/// Gets or sets the CallButtonText
/// </summary>
public string CallButtonText { get; set; }
public EssentialsHelpPropertiesConfig()
{
@@ -437,23 +437,23 @@ namespace PepperDash.Essentials.Room.Config
/// </summary>
public class EssentialsOneButtonMeetingPropertiesConfig
{
[JsonProperty("enable")]
/// <summary>
/// Gets or sets the Enable
/// </summary>
public bool Enable { get; set; }
[JsonProperty("enable")]
/// <summary>
/// Gets or sets the Enable
/// </summary>
public bool Enable { get; set; }
}
public class EssentialsRoomAddressPropertiesConfig
{
[JsonProperty("phoneNumber")]
public string PhoneNumber { get; set; }
[JsonProperty("phoneNumber")]
public string PhoneNumber { get; set; }
[JsonProperty("sipAddress")]
/// <summary>
/// Gets or sets the SipAddress
/// </summary>
public string SipAddress { get; set; }
[JsonProperty("sipAddress")]
/// <summary>
/// Gets or sets the SipAddress
/// </summary>
public string SipAddress { get; set; }
}
@@ -462,14 +462,14 @@ namespace PepperDash.Essentials.Room.Config
/// </summary>
public class EssentialsLogoPropertiesConfig
{
[JsonProperty("type")]
/// <summary>
/// Gets or sets the Type
/// </summary>
public string Type { get; set; }
[JsonProperty("type")]
/// <summary>
/// Gets or sets the Type
/// </summary>
public string Type { get; set; }
[JsonProperty("url")]
public string Url { get; set; }
[JsonProperty("url")]
public string Url { get; set; }
/// <summary>
/// GetLogoUrlLight method
/// </summary>
@@ -478,7 +478,7 @@ namespace PepperDash.Essentials.Room.Config
if (Type == "url")
return Url;
if (Type == "system")
return string.Format("http://{0}:8080/logo.png",
return string.Format("http://{0}:8080/logo.png",
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
return null;
}
@@ -502,22 +502,22 @@ namespace PepperDash.Essentials.Room.Config
/// </summary>
public class EssentialsRoomOccSensorConfig
{
[JsonProperty("deviceKey")]
/// <summary>
/// Gets or sets the DeviceKey
/// </summary>
public string DeviceKey { get; set; }
[JsonProperty("deviceKey")]
/// <summary>
/// Gets or sets the DeviceKey
/// </summary>
public string DeviceKey { get; set; }
[JsonProperty("timeoutMinutes")]
public int TimeoutMinutes { get; set; }
[JsonProperty("timeoutMinutes")]
public int TimeoutMinutes { get; set; }
}
public class EssentialsRoomTechConfig
{
[JsonProperty("password")]
/// <summary>
/// Gets or sets the Password
/// </summary>
public string Password { get; set; }
}
public class EssentialsRoomTechConfig
{
[JsonProperty("password")]
/// <summary>
/// Gets or sets the Password
/// </summary>
public string Password { get; set; }
}
}

View File

@@ -14,14 +14,14 @@ using Serilog.Events;
namespace PepperDash.Essentials.Core
{
////*****************************************************************************
/// <summary>
/// Base class for all subpage reference list controllers
/// </summary>
//public class SubpageReferenceListController
//{
// public SubpageReferenceList TheList { get; protected set; }
//}
////*****************************************************************************
///// <summary>
///// Base class for all subpage reference list controllers
///// </summary>
//public class SubpageReferenceListController
//{
// public SubpageReferenceList TheList { get; protected set; }
//}
//*****************************************************************************
/// <summary>
@@ -34,26 +34,26 @@ namespace PepperDash.Essentials.Core
public ushort Count
{
get { return SetNumberOfItemsSig.UShortValue; }
set { SetNumberOfItemsSig.UShortValue = value; }
set { SetNumberOfItemsSig.UShortValue = value; }
}
public ushort MaxDefinedItems { get; private set; }
/// <summary>
/// Gets or sets the ScrollToItemSig
/// </summary>
/// <summary>
/// Gets or sets the ScrollToItemSig
/// </summary>
public UShortInputSig ScrollToItemSig { get; private set; }
UShortInputSig SetNumberOfItemsSig;
/// <summary>
/// Gets or sets the BoolIncrement
/// </summary>
/// <summary>
/// Gets or sets the BoolIncrement
/// </summary>
public uint BoolIncrement { get; protected set; }
/// <summary>
/// Gets or sets the UShortIncrement
/// </summary>
/// <summary>
/// Gets or sets the UShortIncrement
/// </summary>
public uint UShortIncrement { get; protected set; }
/// <summary>
/// Gets or sets the StringIncrement
/// </summary>
/// <summary>
/// Gets or sets the StringIncrement
/// </summary>
public uint StringIncrement { get; protected set; }
protected readonly SmartObject SRL;
@@ -87,8 +87,8 @@ namespace PepperDash.Essentials.Core
SRL.SigChange += new SmartObjectSigChangeEventHandler(SRL_SigChange);
}
else
Debug.LogMessage(LogEventLevel.Information, "ERROR: TriList 0x{0:X2} Cannot load smart object {1}. Verify correct SGD file is loaded",
triList.ID, smartObjectId);
Debug.LogMessage(LogEventLevel.Information, "ERROR: TriList 0x{0:X2} Cannot load smart object {1}. Verify correct SGD file is loaded",
triList.ID, smartObjectId);
}
/// <summary>
@@ -96,17 +96,17 @@ namespace PepperDash.Essentials.Core
/// DOES NOT adjust Count
/// </summary>
/// <param name="item"></param>
/// <summary>
/// AddItem method
/// </summary>
/// <summary>
/// AddItem method
/// </summary>
public void AddItem(SubpageReferenceListItem item)
{
Items.Add(item);
}
/// <summary>
/// Clear method
/// </summary>
/// <summary>
/// Clear method
/// </summary>
public void Clear()
{
// If a line item needs to disconnect an CueActionPair or do something to release RAM
@@ -116,12 +116,12 @@ namespace PepperDash.Essentials.Core
// Clean up the SRL
Count = 1;
ScrollToItemSig.UShortValue = 1;
ScrollToItemSig.UShortValue = 1;
}
/// <summary>
/// Refresh method
/// </summary>
/// <summary>
/// Refresh method
/// </summary>
public void Refresh()
{
foreach (var item in Items) item.Refresh();
@@ -157,7 +157,7 @@ namespace PepperDash.Essentials.Core
public UShortOutputSig GetUShortOutputSig(uint index, uint sigNum)
{
if (sigNum > UShortIncrement) return null;
return SRL.UShortOutput.FirstOrDefault(s => s.Name.Equals(GetUShortOutputSigName(index, sigNum)));
return SRL.UShortOutput.FirstOrDefault(s => s.Name.Equals(GetUShortOutputSigName(index, sigNum)));
}
/// <summary>
@@ -172,7 +172,7 @@ namespace PepperDash.Essentials.Core
public StringOutputSig GetStringOutputSig(uint index, uint sigNum)
{
if (sigNum > StringIncrement) return null;
return SRL.StringOutput.FirstOrDefault(s => s.Name.Equals(GetStringOutputSigName(index, sigNum)));
return SRL.StringOutput.FirstOrDefault(s => s.Name.Equals(GetStringOutputSigName(index, sigNum)));
}
/// <summary>
@@ -263,9 +263,9 @@ namespace PepperDash.Essentials.Core
/// </summary>
/// <param name="currentDevice"></param>
/// <param name="args"></param>
/// <summary>
/// SRL_SigChange method
/// </summary>
/// <summary>
/// SRL_SigChange method
/// </summary>
public static void SRL_SigChange(GenericBase currentDevice, SmartObjectEventArgs args)
{
var uo = args.Sig.UserObject;

View File

@@ -6,9 +6,9 @@ using Serilog.Events;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Represents a ModalDialog
/// </summary>
/// <summary>
/// Represents a ModalDialog
/// </summary>
public class ModalDialog
{
/// <summary>
@@ -19,10 +19,10 @@ namespace PepperDash.Essentials.Core
/// Bool press 3992
/// </summary>
public const uint Button2Join = 3992;
/// <summary>
/// 3993
/// </summary>
public const uint CancelButtonJoin = 3993;
/// <summary>
/// 3993
/// </summary>
public const uint CancelButtonJoin = 3993;
/// <summary>
///For visibility of single button. Bool feedback 3994
/// </summary>
@@ -35,19 +35,19 @@ namespace PepperDash.Essentials.Core
/// Shows the timer guage if in use. Bool feedback 3996
/// </summary>
public const uint TimerVisibleJoin = 3996;
/// <summary>
/// Visibility join to show "X" button 3997
/// </summary>
public const uint CancelVisibleJoin = 3997;
/// <summary>
/// Visibility join to show "X" button 3997
/// </summary>
public const uint CancelVisibleJoin = 3997;
/// <summary>
/// Shows the modal subpage. Boolean feeback join 3999
/// </summary>
public const uint ModalVisibleJoin = 3999;
/// <summary>
/// The seconds value of the countdown timer. Ushort join 3991
/// </summary>
//public const uint TimerSecondsJoin = 3991;
///// <summary>
///// The seconds value of the countdown timer. Ushort join 3991
///// </summary>
//public const uint TimerSecondsJoin = 3991;
/// <summary>
/// The full ushort value of the countdown timer for a gauge. Ushort join 3992
/// </summary>
@@ -77,15 +77,15 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Returns true when modal is showing
/// </summary>
public bool ModalIsVisible
{
get { return TriList.BooleanInput[ModalVisibleJoin].BoolValue; }
public bool ModalIsVisible
{
get { return TriList.BooleanInput[ModalVisibleJoin].BoolValue; }
}
/// <summary>
///
/// </summary>
public bool CanCancel { get; private set; }
/// <summary>
///
/// </summary>
public bool CanCancel { get; private set; }
BasicTriList TriList;
@@ -103,10 +103,10 @@ namespace PepperDash.Essentials.Core
TriList = triList;
// Attach actions to buttons
triList.SetSigFalseAction(Button1Join, () => OnModalComplete(1));
triList.SetSigFalseAction(Button1Join, () => OnModalComplete(1));
triList.SetSigFalseAction(Button2Join, () => OnModalComplete(2));
triList.SetSigFalseAction(CancelButtonJoin, () => { if (CanCancel) CancelDialog(); });
CanCancel = true;
triList.SetSigFalseAction(CancelButtonJoin, () => { if (CanCancel) CancelDialog(); });
CanCancel = true;
}
/// <summary>
@@ -117,7 +117,7 @@ namespace PepperDash.Essentials.Core
/// <param name="decreasingGauge">If the progress bar gauge needs to count down instead of up</param>
/// <param name="completeAction">The action to run when the dialog is dismissed. Parameter will be 1 or 2 if button pressed, or 0 if dialog times out</param>
/// <returns>True when modal is created.</returns>
public bool PresentModalDialog(uint numberOfButtons, string title, string iconName,
public bool PresentModalDialog(uint numberOfButtons, string title, string iconName,
string message, string button1Text,
string button2Text, bool showGauge, bool showCancel, Action<uint> completeAction)
{
@@ -151,15 +151,15 @@ namespace PepperDash.Essentials.Core
TriList.StringInput[Button2TextJoin].StringValue = button2Text;
}
// Show/hide guage
TriList.BooleanInput[TimerVisibleJoin].BoolValue = showGauge;
CanCancel = showCancel;
TriList.BooleanInput[CancelVisibleJoin].BoolValue = showCancel;
TriList.BooleanInput[TimerVisibleJoin].BoolValue = showGauge;
CanCancel = showCancel;
TriList.BooleanInput[CancelVisibleJoin].BoolValue = showCancel;
//Reveal and activate
TriList.BooleanInput[ModalVisibleJoin].BoolValue = true;
WakePanel();
WakePanel();
return true;
}
@@ -167,48 +167,48 @@ namespace PepperDash.Essentials.Core
return false;
}
/// <summary>
/// WakePanel method
/// </summary>
public void WakePanel()
{
try
{
var panel = TriList as TswFt5Button;
if (panel != null && panel.ExtenderSystemReservedSigs.BacklightOffFeedback.BoolValue)
panel.ExtenderSystemReservedSigs.BacklightOn();
}
catch
{
Debug.LogMessage(LogEventLevel.Debug, "Error Waking Panel. Maybe testing with Xpanel?");
}
}
/// <summary>
/// CancelDialog method
/// </summary>
public void CancelDialog()
/// <summary>
/// WakePanel method
/// </summary>
public void WakePanel()
{
OnModalComplete(0);
try
{
var panel = TriList as TswFt5Button;
if (panel != null && panel.ExtenderSystemReservedSigs.BacklightOffFeedback.BoolValue)
panel.ExtenderSystemReservedSigs.BacklightOn();
}
catch
{
Debug.LogMessage(LogEventLevel.Debug, "Error Waking Panel. Maybe testing with Xpanel?");
}
}
/// <summary>
/// Hides dialog. Fires no action
/// </summary>
public void HideDialog()
{
TriList.BooleanInput[ModalVisibleJoin].BoolValue = false;
}
/// <summary>
/// CancelDialog method
/// </summary>
public void CancelDialog()
{
OnModalComplete(0);
}
/// <summary>
/// Hides dialog. Fires no action
/// </summary>
public void HideDialog()
{
TriList.BooleanInput[ModalVisibleJoin].BoolValue = false;
}
// When the modal is cleared or times out, clean up the various bits
void OnModalComplete(uint buttonNum)
{
TriList.BooleanInput[ModalVisibleJoin].BoolValue = false;
var action = ModalCompleteAction;
if (action != null)
action(buttonNum);
var action = ModalCompleteAction;
if (action != null)
action(buttonNum);
}
}