docs: update XML comments for Essentials Core

This commit is contained in:
Andrew Welker 2026-02-09 08:58:52 -06:00
parent 0764685c51
commit f88bb13367
260 changed files with 7018 additions and 1318 deletions

View file

@ -19,8 +19,17 @@ namespace PepperDash.Essentials.Core.Presets
/// </summary>
public class DevicePresetsModel : Device
{
/// <summary>
/// Delegate for preset recalled event
/// </summary>
/// <param name="device">device that recalled a preset</param>
/// <param name="channel">channel that was recalled</param>
public delegate void PresetRecalledCallback(ISetTopBoxNumericKeypad device, string channel);
/// <summary>
/// Delegate for presets saved event
/// </summary>
/// <param name="presets">list of presets that were saved</param>
public delegate void PresetsSavedCallback(List<PresetChannel> presets);
private readonly CCriticalSection _fileOps = new CCriticalSection();
@ -37,6 +46,12 @@ namespace PepperDash.Essentials.Core.Presets
private Action<bool> _enterFunction;
private string _filePath;
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">key for the device</param>
/// <param name="setTopBox">set top box device</param>
/// <param name="fileName">file name for presets</param>
public DevicePresetsModel(string key, ISetTopBoxNumericKeypad setTopBox, string fileName)
: this(key, fileName)
{
@ -71,6 +86,11 @@ namespace PepperDash.Essentials.Core.Presets
_enterFunction = setTopBox.KeypadEnter;
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">key for the device</param>
/// <param name="fileName">file name for presets</param>
public DevicePresetsModel(string key, string fileName) : base(key)
{
PulseTime = 150;
@ -88,17 +108,26 @@ namespace PepperDash.Essentials.Core.Presets
_initSuccess = true;
}
/// <summary>
/// Event fired when a preset is recalled
/// </summary>
public event PresetRecalledCallback PresetRecalled;
/// <summary>
/// Event fired when presets are saved
/// </summary>
public event PresetsSavedCallback PresetsSaved;
/// <summary>
/// Gets or sets the PulseTime
/// </summary>
public int PulseTime { get; set; }
/// <summary>
/// Gets or sets the DigitSpacingMs
/// </summary>
public int DigitSpacingMs { get; set; }
/// <summary>
/// Gets or sets the PresetsAreLoaded
/// </summary>
@ -109,6 +138,9 @@ namespace PepperDash.Essentials.Core.Presets
/// </summary>
public List<PresetChannel> PresetsList { get; private set; }
/// <summary>
/// Gets the Count of presets
/// </summary>
public int Count
{
get { return PresetsList != null ? PresetsList.Count : 0; }
@ -118,18 +150,25 @@ namespace PepperDash.Essentials.Core.Presets
/// Gets or sets the UseLocalImageStorage
/// </summary>
public bool UseLocalImageStorage { get; set; }
/// <summary>
/// Gets or sets the ImagesLocalHostPrefix
/// </summary>
public string ImagesLocalHostPrefix { get; set; }
/// <summary>
/// Gets or sets the ImagesPathPrefix
/// </summary>
public string ImagesPathPrefix { get; set; }
/// <summary>
/// Gets or sets the ListPathPrefix
/// </summary>
public string ListPathPrefix { get; set; }
/// <summary>
/// Event fired when presets are loaded
/// </summary>
public event EventHandler PresetsLoaded;

View file

@ -8,33 +8,42 @@ using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Core.Presets
{
/// <summary>
/// Represents a DevicePresetsView
/// </summary>
/// <summary>
/// Represents a DevicePresetsView
/// </summary>
public class DevicePresetsView
{
/// <summary>
/// Gets or sets the ShowNumbers
/// </summary>
/// <summary>
/// Gets or sets the ShowNumbers
/// </summary>
public bool ShowNumbers { get; set; }
/// <summary>
/// Gets or sets the ShowName
/// </summary>
/// <summary>
/// Gets or sets the ShowName
/// </summary>
public bool ShowName { get; set; }
/// <summary>
/// Gets or sets the ShowIcon
/// </summary>
/// <summary>
/// Gets or sets the ShowIcon
/// </summary>
public bool ShowIcon { get; set; }
/// <summary>
/// Gets or sets the SRL
/// </summary>
public SubpageReferenceList SRL { get; private set; }
/// <summary>
/// Gets or sets the Model
/// </summary>
/// <summary>
/// Gets or sets the Model
/// </summary>
public DevicePresetsModel Model { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="tl">trilst</param>
/// <param name="model">device presets model</param>
/// <exception cref="ArgumentNullException"></exception>
public DevicePresetsView(BasicTriListWithSmartObject tl, DevicePresetsModel model)
{
if (model == null)
@ -50,9 +59,9 @@ namespace PepperDash.Essentials.Core.Presets
Model.PresetsLoaded += new EventHandler(Model_PresetsLoaded);
}
/// <summary>
/// Attach method
/// </summary>
/// <summary>
/// Attach method
/// </summary>
public void Attach()
{
if (Model.PresetsAreLoaded)
@ -67,9 +76,9 @@ namespace PepperDash.Essentials.Core.Presets
}
}
/// <summary>
/// Detach method
/// </summary>
/// <summary>
/// Detach method
/// </summary>
public void Detach()
{
SRL.Clear();

View file

@ -15,36 +15,37 @@ namespace PepperDash.Essentials.Core.Presets
/// </summary>
public class PresetBase
{
[JsonProperty("id")]
/// <summary>
/// Gets or sets the ID
/// </summary>
[JsonProperty("id")]
public int ID { get; set; }
/// <summary>
/// Used to store the name of the preset
/// </summary>
[JsonProperty("description")]
/// <summary>
/// Gets or sets the Description
/// </summary>
[JsonProperty("description")]
public string Description { get; set; }
/// <summary>
/// Indicates if the preset is defined(stored) in the codec
/// Gets or sets Defined
/// </summary>
[JsonProperty("defined")]
/// <summary>
/// Gets or sets the Defined
/// </summary>
public bool Defined { get; set; }
/// <summary>
/// Indicates if the preset has the capability to be defined
/// </summary>
[JsonProperty("isDefinable")]
/// <summary>
/// Gets or sets the IsDefinable
/// </summary>
[JsonProperty("isDefinable")]
public bool IsDefinable { get; set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="id">id of the preset</param>
/// <param name="description">description of the preset</param>
/// <param name="def">whether the preset is defined</param>
/// <param name="isDef">whether the preset is definable</param>
public PresetBase(int id, string description, bool def, bool isDef)
{
ID = id;

View file

@ -15,40 +15,40 @@ namespace PepperDash.Essentials.Core.Presets
public class PresetChannel
{
/// <summary>
/// Gets or sets the Name
/// </summary>
[JsonProperty(Required = Required.Always,PropertyName = "name")]
/// <summary>
/// Gets or sets the Name
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the IconUrl
/// </summary>
[JsonProperty(Required = Required.Always, PropertyName = "iconUrl")]
/// <summary>
/// Gets or sets the IconUrl
/// </summary>
public string IconUrl { get; set; }
/// <summary>
/// Gets or sets the Channel
/// </summary>
[JsonProperty(Required = Required.Always, PropertyName = "channel")]
/// <summary>
/// Gets or sets the Channel
/// </summary>
public string Channel { get; set; }
}
/// <summary>
/// Represents a PresetsList
/// </summary>
/// <summary>
/// Represents a PresetsList
/// </summary>
public class PresetsList
{
/// <summary>
/// Gets or sets the Name
/// </summary>
[JsonProperty(Required=Required.Always,PropertyName = "name")]
/// <summary>
/// Gets or sets the Name
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the Channels
/// </summary>
[JsonProperty(Required = Required.Always, PropertyName = "channels")]
/// <summary>
/// Gets or sets the Channels
/// </summary>
public List<PresetChannel> Channels { get; set; }
}
}

View file

@ -20,6 +20,13 @@ namespace PepperDash.Essentials.Core.Presets
DevicePresetsView View;
PresetChannel Channel;
/// <summary>
/// Constructor
/// </summary>
/// <param name="chan">preset channel</param>
/// <param name="index">index of the preset</param>
/// <param name="owner">owner of the subpage reference list item</param>
/// <param name="view">device presets view</param>
public PresetsListSubpageReferenceListItem(PresetChannel chan, uint index,
SubpageReferenceList owner, DevicePresetsView view)
: base(index, owner)
@ -30,10 +37,10 @@ namespace PepperDash.Essentials.Core.Presets
Refresh();
}
/// <summary>
/// Clear method
/// </summary>
/// <inheritdoc />
/// <summary>
/// Clear method
/// </summary>
/// <inheritdoc />
public override void Clear()
{
Owner.GetBoolFeedbackSig(Index, 1).UserObject = null;
@ -42,10 +49,10 @@ namespace PepperDash.Essentials.Core.Presets
Owner.StringInputSig(Index, 3).StringValue = "";
}
/// <summary>
/// Refresh method
/// </summary>
/// <inheritdoc />
/// <summary>
/// Refresh method
/// </summary>
/// <inheritdoc />
public override void Refresh()
{
var name = View.ShowName ? Channel.Name : "";