diff --git a/src/PepperDash.Essentials.Core/Ethernet/EthernetStatistics.cs b/src/PepperDash.Essentials.Core/Ethernet/EthernetStatistics.cs index cbdd0617..0f5c2863 100644 --- a/src/PepperDash.Essentials.Core/Ethernet/EthernetStatistics.cs +++ b/src/PepperDash.Essentials.Core/Ethernet/EthernetStatistics.cs @@ -8,24 +8,48 @@ using PepperDash.Essentials.Core; namespace PepperDash.Essentials.Core.Ethernet { + /// + /// Ethernet settings feedbacks + /// public static class EthernetSettings { + /// + /// Link active feedback + /// public static readonly BoolFeedback LinkActive = new BoolFeedback("LinkActive", () => true); + + /// + /// DHCP active feedback + /// public static readonly BoolFeedback DhcpActive = new BoolFeedback("DhcpActive", () => CrestronEthernetHelper.GetEthernetParameter( CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_DHCP_STATE, 0) == "ON"); - + /// + /// Hostname feedback + /// public static readonly StringFeedback Hostname = new StringFeedback("Hostname", () => CrestronEthernetHelper.GetEthernetParameter( CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, 0)); + + /// + /// IP Address feedback + /// public static readonly StringFeedback IpAddress0 = new StringFeedback("IpAddress0", () => CrestronEthernetHelper.GetEthernetParameter( CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0)); + + /// + /// Subnet Mask feedback + /// public static readonly StringFeedback SubnetMask0 = new StringFeedback("SubnetMask0", () => CrestronEthernetHelper.GetEthernetParameter( CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, 0)); + + /// + /// Default Gateway feedback + /// public static readonly StringFeedback DefaultGateway0 = new StringFeedback("DefaultGateway0", () => CrestronEthernetHelper.GetEthernetParameter( CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, 0)); diff --git a/src/PepperDash.Essentials.Core/Extensions/JsonExtensions.cs b/src/PepperDash.Essentials.Core/Extensions/JsonExtensions.cs index 43a84443..74697525 100644 --- a/src/PepperDash.Essentials.Core/Extensions/JsonExtensions.cs +++ b/src/PepperDash.Essentials.Core/Extensions/JsonExtensions.cs @@ -10,11 +10,17 @@ using Newtonsoft.Json.Linq; namespace PepperDash.Essentials.Core { + /// + /// JsonExtensions class + /// public static class JsonExtensions { /// /// FindTokens method /// + /// token for the container + /// name of the token to find + /// list of matching tokens public static List FindTokens(this JToken containerToken, string name) { List matches = new List(); diff --git a/src/PepperDash.Essentials.Core/Extensions/StringExtensions.cs b/src/PepperDash.Essentials.Core/Extensions/StringExtensions.cs index 2efa3c18..9dbb6244 100644 --- a/src/PepperDash.Essentials.Core/Extensions/StringExtensions.cs +++ b/src/PepperDash.Essentials.Core/Extensions/StringExtensions.cs @@ -7,6 +7,9 @@ using Crestron.SimplSharp; namespace PepperDash.Essentials.Core { + /// + /// StringExtensions class + /// public static class StringExtensions { /// @@ -14,9 +17,6 @@ namespace PepperDash.Essentials.Core /// /// string input /// null if the string is emtpy, otherwise returns the string - /// - /// NullIfEmpty method - /// public static string NullIfEmpty(this string s) { return string.IsNullOrEmpty(s) ? null : s; @@ -27,9 +27,6 @@ namespace PepperDash.Essentials.Core /// /// string input /// null if the string is wempty or made of only whitespace characters, otherwise returns the string - /// - /// NullIfWhiteSpace method - /// public static string NullIfWhiteSpace(this string s) { return string.IsNullOrEmpty(s.Trim()) ? null : s; @@ -41,9 +38,6 @@ namespace PepperDash.Essentials.Core /// input string /// string to replace with if input string is empty or whitespace /// returns newString if s is null, emtpy, or made of whitespace characters, otherwise returns s - /// - /// ReplaceIfNullOrEmpty method - /// public static string ReplaceIfNullOrEmpty(this string s, string newString) { return string.IsNullOrEmpty(s) ? newString : s; @@ -56,9 +50,6 @@ namespace PepperDash.Essentials.Core /// String to check in Source String /// Comparison parameters /// true of string contains "toCheck" - /// - /// Contains method - /// public static bool Contains(this string source, string toCheck, StringComparison comp) { if (string.IsNullOrEmpty(source)) return false; @@ -70,9 +61,6 @@ namespace PepperDash.Essentials.Core /// /// String to Trim /// Trimmed String - /// - /// TrimAll method - /// public static string TrimAll(this string source) { return string.IsNullOrEmpty(source) ? string.Empty : source.TrimStart().TrimEnd(); @@ -84,9 +72,6 @@ namespace PepperDash.Essentials.Core /// String to Trim /// Char Array to trim from string /// Trimmed String - /// - /// TrimAll method - /// public static string TrimAll(this string source, char[] chars) { return string.IsNullOrEmpty(source) ? string.Empty : source.TrimStart(chars).TrimEnd(chars); diff --git a/src/PepperDash.Essentials.Core/Factory/ProcessorExtensionDeviceFactory.cs b/src/PepperDash.Essentials.Core/Factory/ProcessorExtensionDeviceFactory.cs index 02bf1bcd..6336795c 100644 --- a/src/PepperDash.Essentials.Core/Factory/ProcessorExtensionDeviceFactory.cs +++ b/src/PepperDash.Essentials.Core/Factory/ProcessorExtensionDeviceFactory.cs @@ -15,6 +15,9 @@ namespace PepperDash.Essentials.Core /// public class ProcessorExtensionDeviceFactory { + /// + /// Constructor + /// public ProcessorExtensionDeviceFactory() { var assy = Assembly.GetExecutingAssembly(); PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy); @@ -50,7 +53,8 @@ namespace PepperDash.Essentials.Core /// /// Adds a plugin factory method /// - /// + /// name fo extension to add + /// method to add /// public static void AddFactoryForType(string extensionName, Func method) { @@ -58,6 +62,13 @@ namespace PepperDash.Essentials.Core ProcessorExtensionDeviceFactory.ProcessorExtensionFactoryMethods.Add(extensionName, new DeviceFactoryWrapper() { FactoryMethod = method }); } + /// + /// Adds a plugin factory method with type and description + /// + /// name of extension to add + /// description of extension to add + /// type of extension to add + /// method to add public static void AddFactoryForType(string extensionName, string description, Type Type, Func method) { //Debug.LogMessage(LogEventLevel.Debug, "Adding factory method for type '{0}'", typeName); diff --git a/src/PepperDash.Essentials.Core/Factory/ReadyEventArgs.cs b/src/PepperDash.Essentials.Core/Factory/ReadyEventArgs.cs index 1b917690..544ef5cc 100644 --- a/src/PepperDash.Essentials.Core/Factory/ReadyEventArgs.cs +++ b/src/PepperDash.Essentials.Core/Factory/ReadyEventArgs.cs @@ -17,6 +17,10 @@ namespace PepperDash.Essentials.Core /// public bool IsReady { get; set; } + /// + /// Constructor + /// + /// indicates if the object is ready public IsReadyEventArgs(bool data) { IsReady = data; @@ -28,7 +32,14 @@ namespace PepperDash.Essentials.Core /// public interface IHasReady { + /// + /// Fires when the IsReady property changes + /// event EventHandler IsReadyEvent; + + /// + /// indicates whether the object is ready + /// bool IsReady { get; } } } diff --git a/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedback.cs b/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedback.cs index eb3abbb4..ea222b7f 100644 --- a/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedback.cs +++ b/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedback.cs @@ -63,6 +63,10 @@ namespace PepperDash.Essentials.Core ValueFunc = valueFunc; } + /// + /// Sets the ValueFunc + /// + /// New function to set as the ValueFunc public void SetValueFunc(Func newFunc) { ValueFunc = newFunc; @@ -153,6 +157,10 @@ namespace PepperDash.Essentials.Core LinkedCrestronFeedbacks.Remove(feedback); } + /// + /// ToString override + /// + /// public override string ToString() { return (InTestMode ? "TEST -- " : "") + BoolValue.ToString(); diff --git a/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedbackOneShot.cs b/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedbackOneShot.cs index 7dca3eaf..6b0b39b8 100644 --- a/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedbackOneShot.cs +++ b/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedbackOneShot.cs @@ -48,12 +48,8 @@ namespace PepperDash.Essentials.Core } /// - /// Starts the + /// Start method /// - /// - /// - /// Start method - /// public void Start() { if (Timer == null) diff --git a/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedbackPulseExtender.cs b/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedbackPulseExtender.cs index 53a5e559..3a9dccde 100644 --- a/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedbackPulseExtender.cs +++ b/src/PepperDash.Essentials.Core/Feedbacks/BoolFeedbackPulseExtender.cs @@ -12,7 +12,14 @@ namespace PepperDash.Essentials.Core /// public class BoolFeedbackPulseExtender { + /// + /// Gets or sets the TimeoutMs + /// public uint TimeoutMs { get; set; } + + /// + /// Gets the Feedback + /// public BoolFeedback Feedback { get; private set; } CTimer Timer; diff --git a/src/PepperDash.Essentials.Core/Feedbacks/BoolOutputLogicals.cs b/src/PepperDash.Essentials.Core/Feedbacks/BoolOutputLogicals.cs index b4562904..901b80dd 100644 --- a/src/PepperDash.Essentials.Core/Feedbacks/BoolOutputLogicals.cs +++ b/src/PepperDash.Essentials.Core/Feedbacks/BoolOutputLogicals.cs @@ -8,7 +8,9 @@ using Crestron.SimplSharpPro; namespace PepperDash.Essentials.Core { - + /// + /// Abstract base class for BoolOutputLogicals + /// public abstract class BoolFeedbackLogic { /// @@ -21,13 +23,23 @@ namespace PepperDash.Essentials.Core /// protected List OutputsIn = new List(); + /// + /// Gets or sets the ComputedValue + /// protected bool ComputedValue; + /// + /// Constructor + /// protected BoolFeedbackLogic() { Output = new BoolFeedback(() => ComputedValue); } + /// + /// AddOutputIn method + /// + /// feedback to add public void AddOutputIn(BoolFeedback output) { // Don't double up outputs @@ -38,9 +50,10 @@ namespace PepperDash.Essentials.Core Evaluate(); } - /// - /// AddOutputsIn method - /// + /// + /// AddOutputsIn method + /// + /// feedbacks to add public void AddOutputsIn(List outputs) { foreach (var o in outputs.Where(o => !OutputsIn.Contains(o))) @@ -51,9 +64,10 @@ namespace PepperDash.Essentials.Core Evaluate(); } - /// - /// RemoveOutputIn method - /// + /// + /// RemoveOutputIn method + /// + /// feedback to remove public void RemoveOutputIn(BoolFeedback output) { // Don't double up outputs @@ -64,9 +78,10 @@ namespace PepperDash.Essentials.Core Evaluate(); } - /// - /// RemoveOutputsIn method - /// + /// + /// RemoveOutputsIn method + /// + /// feedbacks to remove public void RemoveOutputsIn(List outputs) { foreach (var o in outputs) @@ -77,20 +92,28 @@ namespace PepperDash.Essentials.Core Evaluate(); } - /// - /// ClearOutputs method - /// + /// + /// ClearOutputs method + /// public void ClearOutputs() { OutputsIn.Clear(); Evaluate(); } + /// + /// AnyInput_OutputChange event handler + /// + /// + /// void AnyInput_OutputChange(object sender, EventArgs e) { Evaluate(); } + /// + /// Evaluate method + /// protected abstract void Evaluate(); } @@ -99,6 +122,9 @@ namespace PepperDash.Essentials.Core /// public class BoolFeedbackAnd : BoolFeedbackLogic { + /// + /// Evaluate method + /// protected override void Evaluate() { var prevValue = ComputedValue; @@ -112,11 +138,14 @@ namespace PepperDash.Essentials.Core } } - /// - /// Represents a BoolFeedbackOr - /// + /// + /// Represents a BoolFeedbackOr + /// public class BoolFeedbackOr : BoolFeedbackLogic { + /// + /// Evaluate method + /// protected override void Evaluate() { var prevValue = ComputedValue; @@ -130,19 +159,26 @@ namespace PepperDash.Essentials.Core } } - /// - /// Represents a BoolFeedbackLinq - /// + /// + /// Represents a BoolFeedbackLinq + /// public class BoolFeedbackLinq : BoolFeedbackLogic { readonly Func, bool> _predicate; + /// + /// Constructor + /// + /// public BoolFeedbackLinq(Func, bool> predicate) : base() { _predicate = predicate; } + /// + /// Evaluate method + /// protected override void Evaluate() { var prevValue = ComputedValue; diff --git a/src/PepperDash.Essentials.Core/Feedbacks/FeedbackBase.cs b/src/PepperDash.Essentials.Core/Feedbacks/FeedbackBase.cs index 723d22a6..0c756ace 100644 --- a/src/PepperDash.Essentials.Core/Feedbacks/FeedbackBase.cs +++ b/src/PepperDash.Essentials.Core/Feedbacks/FeedbackBase.cs @@ -102,12 +102,19 @@ namespace PepperDash.Essentials.Core if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value)); } + /// + /// Helper method that fires event. Use this intstead of calling OutputChange + /// + /// value to seed eventArgs protected void OnOutputChange(int value) { if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value)); } - + /// + /// Helper method that fires event. Use this intstead of calling OutputChange + /// + /// value to seed eventArgs protected void OnOutputChange(string value) { if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value)); diff --git a/src/PepperDash.Essentials.Core/Feedbacks/FeedbackEventArgs.cs b/src/PepperDash.Essentials.Core/Feedbacks/FeedbackEventArgs.cs index d2182245..e22e9366 100644 --- a/src/PepperDash.Essentials.Core/Feedbacks/FeedbackEventArgs.cs +++ b/src/PepperDash.Essentials.Core/Feedbacks/FeedbackEventArgs.cs @@ -15,10 +15,15 @@ namespace PepperDash.Essentials.Core /// Gets or sets the BoolValue /// public bool BoolValue { get; private set; } + /// /// Gets or sets the IntValue /// public int IntValue { get; private set; } + + /// + /// Gets or sets the UShortValue + /// public ushort UShortValue { get @@ -26,27 +31,41 @@ namespace PepperDash.Essentials.Core return (ushort)IntValue; } } + /// /// Gets or sets the StringValue /// public string StringValue { get; private set; } + /// /// Gets or sets the Type /// public eFeedbackEventType Type { get; private set; } + /// + /// Constructor for BoolValue + /// + /// value to set public FeedbackEventArgs(bool value) { BoolValue = value; Type = eFeedbackEventType.TypeBool; } + /// + /// Constructor for IntValue + /// + /// value to set public FeedbackEventArgs(int value) { IntValue = value; Type = eFeedbackEventType.TypeInt; } + /// + /// Constructor for StringValue + /// + /// value to set public FeedbackEventArgs(string value) { StringValue = value; @@ -59,8 +78,19 @@ namespace PepperDash.Essentials.Core /// public enum eFeedbackEventType { + /// + /// Boolean type feedback event + /// TypeBool, + + /// + /// Integer type feedback event + /// TypeInt, + + /// + /// String type feedback event + /// TypeString } } \ No newline at end of file diff --git a/src/PepperDash.Essentials.Core/Feedbacks/IntFeedback.cs b/src/PepperDash.Essentials.Core/Feedbacks/IntFeedback.cs index ee23e310..4dd0424b 100644 --- a/src/PepperDash.Essentials.Core/Feedbacks/IntFeedback.cs +++ b/src/PepperDash.Essentials.Core/Feedbacks/IntFeedback.cs @@ -64,6 +64,10 @@ namespace PepperDash.Essentials.Core ValueFunc = valueFunc; } + /// + /// Sets the ValueFunc + /// + /// function to set public void SetValueFunc(Func newFunc) { ValueFunc = newFunc; diff --git a/src/PepperDash.Essentials.Core/Feedbacks/SerialFeedback.cs b/src/PepperDash.Essentials.Core/Feedbacks/SerialFeedback.cs index b26e23e6..1bde5a08 100644 --- a/src/PepperDash.Essentials.Core/Feedbacks/SerialFeedback.cs +++ b/src/PepperDash.Essentials.Core/Feedbacks/SerialFeedback.cs @@ -13,6 +13,9 @@ namespace PepperDash.Essentials.Core /// public class SerialFeedback : Feedback { + /// + /// Gets the SerialValue + /// public override string SerialValue { get { return _SerialValue; } } string _SerialValue; @@ -25,11 +28,18 @@ namespace PepperDash.Essentials.Core List LinkedInputSigs = new List(); + /// + /// Constructor + /// [Obsolete("use constructor with Key parameter. This constructor will be removed in a future version")] public SerialFeedback() { } + /// + /// Constructor with Key parameter + /// + /// Key to find this Feedback public SerialFeedback(string key) : base(key) { diff --git a/src/PepperDash.Essentials.Core/Feedbacks/StringFeedback.cs b/src/PepperDash.Essentials.Core/Feedbacks/StringFeedback.cs index f7d594c4..4c419903 100644 --- a/src/PepperDash.Essentials.Core/Feedbacks/StringFeedback.cs +++ b/src/PepperDash.Essentials.Core/Feedbacks/StringFeedback.cs @@ -59,6 +59,10 @@ namespace PepperDash.Essentials.Core ValueFunc = valueFunc; } + /// + /// Sets the ValueFunc + /// + /// function to set public void SetValueFunc(Func newFunc) { ValueFunc = newFunc; diff --git a/src/PepperDash.Essentials.Core/File/FileIO.cs b/src/PepperDash.Essentials.Core/File/FileIO.cs index 0c41522b..df1c0750 100644 --- a/src/PepperDash.Essentials.Core/File/FileIO.cs +++ b/src/PepperDash.Essentials.Core/File/FileIO.cs @@ -10,14 +10,23 @@ using Serilog.Events; namespace PepperDash.Essentials.Core { + /// + /// Static class for FileIO operations + /// public static class FileIO { static CCriticalSection fileLock = new CCriticalSection(); - /// - /// Delegate for GotFileEventHandler - /// + /// + /// Delegate for GotFileEventHandler + /// + /// + /// public delegate void GotFileEventHandler(object sender, FileEventArgs e); + + /// + /// Event for GotFileEvent + /// public static event GotFileEventHandler GotFileEvent; /// @@ -297,6 +306,10 @@ namespace PepperDash.Essentials.Core /// public class FileEventArgs { + /// + /// Constructor + /// + /// public FileEventArgs(string data) { Data = data; } /// /// Gets or sets the Data