mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-28 03:45:01 +00:00
Attempt at modifying device factory mechanism
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user