Merge branch 'feature/rework-plugin-loading-process-to-avoid-assembly-conflicts' into feature/ecs-1209

# Conflicts:
#	essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
This commit is contained in:
Neil Dorin
2020-04-01 11:19:30 -06:00
12 changed files with 201 additions and 718 deletions

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Defines the basic needs for an EssentialsDevice to enable it to be build by an IDeviceFactory class
/// </summary>
public abstract class EssentialsDevice : Device
{
protected EssentialsDevice(string key)
: base(key)
{
}
}
public abstract class Factory : IDeviceFactory
{
#region IDeviceFactory Members
public List<string> TypeNames { get; protected set; }
public virtual void LoadTypeFactories()
{
foreach (var typeName in TypeNames)
{
DeviceFactory.AddFactoryForType(typeName, BuildDevice);
}
}
#endregion
public abstract IKeyed BuildDevice(DeviceConfig dc);
protected Factory()
{
TypeNames = new List<string>();
}
}
}

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.Devices
/// <summary>
///
/// </summary>
public abstract class ReconfigurableDevice : Device
public abstract class ReconfigurableDevice : EssentialsDevice
{
public event EventHandler<EventArgs> ConfigChanged;