From dc25063ca122c777e015cffbc48a0b3d6fb01e99 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Thu, 21 Aug 2025 07:08:21 +0200 Subject: [PATCH] check for abstract types --- Pilz.Plugins.Advanced/PluginFeatureController.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Pilz.Plugins.Advanced/PluginFeatureController.cs b/Pilz.Plugins.Advanced/PluginFeatureController.cs index 4650536..d63d08f 100644 --- a/Pilz.Plugins.Advanced/PluginFeatureController.cs +++ b/Pilz.Plugins.Advanced/PluginFeatureController.cs @@ -111,7 +111,7 @@ public class PluginFeatureController /// If not null, the type will only be processed if it's within the given namespace. public void RegisterAll(Type type, string? @namespace = null) { - if (@namespace != null && type.Namespace != null && type.Namespace != @namespace && !type.Namespace.StartsWith(@namespace + ".")) + if (@namespace != null && type.Namespace != null && type.Namespace != @namespace && !type.Namespace.StartsWith(@namespace + ".") || type.IsAbstract) return; if (type.IsAssignableTo(typeof(IPluginFeaturesProvider))) @@ -171,11 +171,8 @@ public class PluginFeatureController /// public void Register(PluginFeature module) { - if (!features.Contains(module)) - { - features.Add(module); + if (features.Add(module)) OnPluginFeatureReistred?.Invoke(this, module); - } } ///