mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Updates to device factory methodology for use in plugins
This commit is contained in:
parent
f0010a7625
commit
fcc2a5db06
5 changed files with 36 additions and 25 deletions
|
|
@ -13,8 +13,6 @@ using PepperDash.Essentials.Core.Config;
|
|||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Serves as a generic wrapper class for all styles of IBasicCommuncation ports
|
||||
/// </summary>
|
||||
|
|
@ -62,21 +60,19 @@ namespace PepperDash.Essentials.Core
|
|||
ConfigWriter.UpdateDeviceConfig(config);
|
||||
}
|
||||
|
||||
public class Factory : Essentials.Core.Factory
|
||||
{
|
||||
#region IDeviceFactory Members
|
||||
|
||||
List<string> TypeNames = new List<string>() { "genericComm" };
|
||||
|
||||
#endregion
|
||||
|
||||
public override IKeyed BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
|
||||
return new GenericComm(dc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GenericCommFactory : Essentials.Core.EssentialsDeviceFactory<GenericComm>
|
||||
{
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
|
||||
return new GenericComm(dc);
|
||||
}
|
||||
|
||||
public GenericCommFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "genericComm" };
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue