From 50d5850097cc1f2bd4ad7fde1d6012c2a407d7c8 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 26 Mar 2020 14:10:50 -0600 Subject: [PATCH] Changes to instantiate the plugin loader class from the custom plugin --- PepperDashEssentials/PluginLoading/PluginLoading.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PepperDashEssentials/PluginLoading/PluginLoading.cs b/PepperDashEssentials/PluginLoading/PluginLoading.cs index dcffacdd..d12775c7 100644 --- a/PepperDashEssentials/PluginLoading/PluginLoading.cs +++ b/PepperDashEssentials/PluginLoading/PluginLoading.cs @@ -339,9 +339,9 @@ namespace PepperDash.Essentials { try { - var plugin = type as IPluginDeviceConfig; - if (plugin != null) + if (typeof(IPluginDeviceConfig).IsAssignableFrom(type)) { + var plugin = (IPluginDeviceConfig)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type); LoadCustomPlugin(plugin, loadedAssembly); } else