mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-13 04:26:49 +00:00
fix: add changes from code review
This commit is contained in:
parent
08cc84a8e8
commit
58bcc3315d
3 changed files with 286 additions and 4 deletions
|
|
@ -19,11 +19,10 @@ namespace PepperDash.Essentials.Core
|
|||
{
|
||||
foreach (var typeName in TypeNames)
|
||||
{
|
||||
//Debug.LogMessage(LogEventLevel.Verbose, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
|
||||
var descriptionAttribute = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
|
||||
string description = descriptionAttribute != null && descriptionAttribute.Length > 0
|
||||
? descriptionAttribute[0].Description
|
||||
: throw new InvalidOperationException($"No DescriptionAttribute found for type {typeof(T).FullName}");
|
||||
string description = descriptionAttribute != null && descriptionAttribute.Length > 0
|
||||
? descriptionAttribute[0].Description
|
||||
: "No description available";
|
||||
var snippetAttribute = typeof(T).GetCustomAttributes(typeof(ConfigSnippetAttribute), true) as ConfigSnippetAttribute[];
|
||||
ProcessorExtensionDeviceFactory.AddFactoryForType(typeName.ToLower(), description, typeof(T), BuildDevice);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ namespace PepperDash.Essentials.Core
|
|||
/// it will NOT reflect an actual value from a device until <seealso cref="FireUpdate"/> has been called
|
||||
/// </remarks>
|
||||
/// <param name="valueFunc">Delegate to invoke when this feedback needs to be updated</param>
|
||||
[Obsolete("use constructor with Key parameter. This constructor will be removed in a future version")]
|
||||
public IntFeedback(Func<int> valueFunc)
|
||||
: this(null, valueFunc)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue