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

@@ -70,6 +70,11 @@ namespace PepperDash.Essentials
{
version = Global.AssemblyVersion;
assembly = Assembly.GetExecutingAssembly();
break;
}
case ("PepperDashEssentialsBase.dll"):
{
break;
}
case ("PepperDash_Core.dll"):
@@ -339,9 +344,9 @@ namespace PepperDash.Essentials
{
try
{
if (typeof(IPluginDeviceConfig).IsAssignableFrom(type))
if (typeof(IPluginDeviceFactory).IsAssignableFrom(type))
{
var plugin = (IPluginDeviceConfig)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
var plugin = (IPluginDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
LoadCustomPlugin(plugin, loadedAssembly);
}
else
@@ -377,7 +382,7 @@ namespace PepperDash.Essentials
/// Loads a
/// </summary>
/// <param name="plugin"></param>
static void LoadCustomPlugin(IPluginDeviceConfig plugin, LoadedAssembly loadedAssembly)
static void LoadCustomPlugin(IPluginDeviceFactory plugin, LoadedAssembly loadedAssembly)
{
var passed = Global.IsRunningMinimumVersionOrHigher(plugin.MinimumEssentialsFrameworkVersion);
@@ -392,7 +397,7 @@ namespace PepperDash.Essentials
}
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading plugin: {0}", loadedAssembly.Name);
plugin.LoadPlugin();
plugin.LoadTypeFactories();
}
/// <summary>