Refactored for source change handler updates

This commit is contained in:
Neil Dorin
2019-11-08 12:30:49 -07:00
parent c22e95cad2
commit ed468add2c
19 changed files with 178 additions and 73 deletions

View File

@@ -12,7 +12,7 @@ using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Core
{
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IPower, IWarmingCooling, IRoutingSinkWithSwitching
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IPower, IWarmingCooling
{
public IrOutputPortController IrPort { get; private set; }
public ushort IrPulseTime { get; set; }

View File

@@ -20,8 +20,29 @@ namespace PepperDash.Essentials.Core
{
public event SourceInfoChangeHandler CurrentSourceChange;
public string CurrentSourceInfoKey { get; protected set; }
public SourceListItem CurrentSourceInfo { get; protected set; }
public string CurrentSourceInfoKey { get; set; }
public SourceListItem CurrentSourceInfo
{
get
{
return _CurrentSourceInfo;
}
set
{
if (value == _CurrentSourceInfo) return;
var handler = CurrentSourceChange;
if (handler != null)
handler(_CurrentSourceInfo, ChangeType.WillChange);
_CurrentSourceInfo = value;
if (handler != null)
handler(_CurrentSourceInfo, ChangeType.DidChange);
}
}
SourceListItem _CurrentSourceInfo;
public BoolFeedback PowerIsOnFeedback { get; protected set; }
public BoolFeedback IsCoolingDownFeedback { get; protected set; }