using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
///
/// A helper class to make it easier to work with Crestron Sigs
///
public abstract class SigCommandBase : IKeyed
{
public string Key { get; private set; }
///
/// Base Constructor - empty
///
protected SigCommandBase()
{
}
protected SigCommandBase(string key)
{
if (key == null)
Key = "";
else
Key = key;
}
///
/// Computes the value by running the ValueFunc and if the value has changed, updates the linked sigs and fires the OnOutputChange event
///
public abstract void FireUpdate();
///
/// Fires the update asynchronously within a CrestronInvoke
///
public void InvokeFireUpdate()
{
CrestronInvoke.BeginInvoke(o => FireUpdate());
}
}
}