mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-14 13:07:18 +00:00
Progress on abstract base classes and interfaces
This commit is contained in:
parent
657b9f1f54
commit
f0299729e6
4 changed files with 11 additions and 7 deletions
|
|
@ -64,17 +64,19 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Devices the basic needs for a Device Factory
|
/// Defines the basic needs for a Device Factory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class EssentialsDeviceFactory<T> : IDeviceFactory where T:EssentialsDevice
|
public abstract class EssentialsDeviceFactory<T> : IDeviceFactory where T:EssentialsDevice
|
||||||
{
|
{
|
||||||
#region IDeviceFactory Members
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A list of strings that can be used in the type property of a DeviceConfig object to build an instance of this device
|
/// A list of strings that can be used in the type property of a DeviceConfig object to build an instance of this device
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> TypeNames { get; protected set; }
|
public List<string> TypeNames { get; protected set; }
|
||||||
|
|
||||||
|
|
||||||
|
#region IDeviceFactory Members
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads an item to the DeviceFactory.FactoryMethods dictionary for each entry in the TypeNames list
|
/// Loads an item to the DeviceFactory.FactoryMethods dictionary for each entry in the TypeNames list
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -90,6 +92,8 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The method that will build the device
|
/// The method that will build the device
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -97,11 +101,10 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <returns>An instance of the device</returns>
|
/// <returns>An instance of the device</returns>
|
||||||
public abstract EssentialsDevice BuildDevice(DeviceConfig dc);
|
public abstract EssentialsDevice BuildDevice(DeviceConfig dc);
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Devices the basic needs for a Device Factory
|
/// Defines the basic needs for a Device Factory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class EssentialsPluginDeviceFactory<T> : EssentialsDeviceFactory<T>, IPluginDeviceFactory where T : EssentialsDevice
|
public abstract class EssentialsPluginDeviceFactory<T> : EssentialsDeviceFactory<T>, IPluginDeviceFactory where T : EssentialsDevice
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace PepperDash.Essentials.Core
|
||||||
public interface IDeviceFactory
|
public interface IDeviceFactory
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads all the types to the DeviceFactory
|
/// Loads all the types to the Factory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void LoadTypeFactories();
|
void LoadTypeFactories();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ namespace PepperDash.Essentials.Core.Room.Components
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IComponentFactory : IDeviceFactory
|
public interface IComponentFactory : IDeviceFactory
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ComponentFactory
|
public static class ComponentFactory
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Interfaces.Components;
|
using PepperDash.Essentials.Core.Interfaces.Components;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Room.Components
|
namespace PepperDash.Essentials.Core.Room.Components
|
||||||
|
|
@ -11,6 +13,7 @@ namespace PepperDash.Essentials.Core.Room.Components
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The base class from which Room Components should be derived
|
/// The base class from which Room Components should be derived
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("The base Essentials Device Class")]
|
||||||
public abstract class RoomComponentBase : IRoomComponent
|
public abstract class RoomComponentBase : IRoomComponent
|
||||||
{
|
{
|
||||||
private string _componentKey;
|
private string _componentKey;
|
||||||
|
|
@ -108,5 +111,4 @@ namespace PepperDash.Essentials.Core.Room.Components
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue