namespace Pilz.Plugins.Advanced.UI.Extensions; public static class PluginFeatureControllerExtensions { public static ControlManager ApplyControlManager(this PluginFeatureController @this, Control control) { return ApplyControlManager(@this, control, true, true); } public static ControlManager ApplyControlManager(this PluginFeatureController @this, Control control, bool recursive, bool autoTrack) { var manager = new ControlManager(@this, autoTrack); goThrow(control); return manager; void goThrow(Control control) { manager.RegisterControl(control); if (recursive) { foreach (var child in control.Controls) { if (child is Control childControl) goThrow(childControl); } } } } }