namespace Pilz.Plugins.Advanced.UI.Extensions; public static class PluginFeatureControllerExtensions { public static IControlListener ApplyControlManager(this PluginFeatureController @this, string featureType, Control control) { return ApplyControlManager(@this, featureType, control, true, true); } public static IControlListener ApplyControlManager(this PluginFeatureController @this, string featureType, Control control, PluginFunctionParameter? parameter) { return ApplyControlManager(@this, featureType, control, true, true, parameter); } public static IControlListener ApplyControlManager(this PluginFeatureController @this, string featureType, Control control, bool recursive, bool autoTrack) { return ApplyControlManager(@this, featureType, control, recursive, autoTrack, null); } public static IControlListener ApplyControlManager(this PluginFeatureController @this, string featureType, Control control, bool recursive, bool autoTrack, PluginFunctionParameter? parameter) { var manager = new ControlListener(@this.Features.Get(featureType).OfType(), control, recursive); if (autoTrack) manager.Track(); manager.Initialize(parameter); return manager; } }