mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 03:57:27 +00:00
Attempt at modifying device factory mechanism
This commit is contained in:
parent
ca27e01f94
commit
a403a8b81f
7 changed files with 120 additions and 12 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue