fix: remove inheritance and keep separate fb in class.

This commit is contained in:
Jason Alborough
2022-04-29 17:34:20 -04:00
parent 9805c91431
commit ab1008ef70
3 changed files with 15 additions and 12 deletions

View File

@@ -6,9 +6,10 @@ using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Feedbacks
{
public class BoolWithFeedback : BoolFeedback
public class BoolWithFeedback
{
private bool _Value;
public BoolFeedback Feedback;
public bool Value
{
get
@@ -18,13 +19,13 @@ namespace PepperDash.Essentials.Core.Feedbacks
set
{
_Value = value;
this.FireUpdate();
Feedback.FireUpdate();
}
}
public BoolWithFeedback()
: base(() => Value)
{
Feedback = new BoolFeedback(() => { return Value; });
}
}

View File

@@ -6,9 +6,10 @@ using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Feedbacks
{
public class IntWithFeedback : IntFeedback
public class IntWithFeedback
{
private int _Value;
public IntFeedback Feedback;
public int Value
{
get
@@ -18,13 +19,13 @@ namespace PepperDash.Essentials.Core.Feedbacks
set
{
_Value = value;
this.FireUpdate();
Feedback.FireUpdate();
}
}
public IntWithFeedback()
: base(() => Value)
{
Feedback = new IntFeedback((() => Value));
}
}
}

View File

@@ -6,9 +6,10 @@ using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Feedbacks
{
public class StringWithFeedback : StringFeedback
public class StringWithFeedback
{
private string _Value;
public StringFeedback Feedback;
public string Value
{
get
@@ -18,13 +19,13 @@ namespace PepperDash.Essentials.Core.Feedbacks
set
{
_Value = value;
this.FireUpdate();
Feedback.FireUpdate();
}
}
public StringWithFeedback()
: base(() => Value)
{
Feedback = new StringFeedback(() => Value);
}
}
}