Attempt at modifying device factory mechanism

This commit is contained in:
Neil Dorin
2020-03-26 16:10:54 -06:00
parent ca27e01f94
commit a403a8b81f
7 changed files with 120 additions and 12 deletions

View File

@@ -1,15 +1,28 @@
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.Plugins
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Defines a class that is capable of loading custom plugin device types
/// </summary>
public interface IPluginDeviceConfig
public interface IPluginDeviceFactory : IDeviceFactory
{
/// <summary>
/// Required to define the minimum version for Essentials in the format xx.yy.zz
/// </summary>
string MinimumEssentialsFrameworkVersion { get; }
void LoadPlugin();
IKeyed BuildDevice(DeviceConfig dc);
}
/// <summary>
/// Defines a class that is capable of loading device types
/// </summary>
public interface IDeviceFactory
{
/// <summary>
/// Will be called when the plugin is loaded by Essentials. Must add any new types to the DeviceFactory using DeviceFactory.AddFactoryForType() for each new type
/// </summary>
void LoadTypeFactories();
}
}