-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
165 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
using PepperDash.Essentials.Core.DeviceTypeInterfaces; | ||
using PepperDash.Essentials.Core.Queues; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Epi.Display.Lg | ||
{ | ||
#if SERIES4 | ||
public class LgInputs : ISelectableItems<string> | ||
{ | ||
private Dictionary<string, ISelectableItem> _items = new Dictionary<string, ISelectableItem>(); | ||
|
||
public Dictionary<string, ISelectableItem> Items | ||
{ | ||
get | ||
{ | ||
return _items; | ||
} | ||
set | ||
{ | ||
if (_items == value) | ||
return; | ||
|
||
_items = value; | ||
|
||
ItemsUpdated?.Invoke(this, null); | ||
} | ||
} | ||
|
||
private string _currentItem; | ||
|
||
public string CurrentItem | ||
{ | ||
get | ||
{ | ||
return _currentItem; | ||
} | ||
set | ||
{ | ||
if (_currentItem == value) | ||
return; | ||
|
||
_currentItem = value; | ||
|
||
CurrentItemChanged?.Invoke(this, null); | ||
} | ||
} | ||
|
||
public event EventHandler ItemsUpdated; | ||
public event EventHandler CurrentItemChanged; | ||
|
||
} | ||
|
||
public class LgInput : ISelectableItem | ||
{ | ||
private bool _isSelected; | ||
|
||
private readonly LgDisplayController _parent; | ||
|
||
public LgInput(string key, string name, LgDisplayController parent) | ||
{ | ||
Key = key; | ||
Name = name; | ||
_parent = parent; | ||
} | ||
|
||
public string Key { get; private set; } | ||
public string Name { get; private set; } | ||
|
||
public event EventHandler ItemUpdated; | ||
|
||
public bool IsSelected | ||
{ | ||
get { return _isSelected; } | ||
set | ||
{ | ||
if (value == _isSelected) | ||
return; | ||
|
||
_isSelected = value; | ||
var handler = ItemUpdated; | ||
if (handler != null) | ||
handler(this, EventArgs.Empty); | ||
} | ||
} | ||
|
||
public void Select() | ||
{ | ||
_parent.SendData(Key); | ||
} | ||
} | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters