change UI to UI.WinForms

This commit is contained in:
2025-06-16 11:50:17 +02:00
parent fa3a9da07e
commit 299867a910
116 changed files with 318 additions and 319 deletions

View File

@@ -0,0 +1,36 @@
namespace Pilz.Plugins.Advanced.UI.WinForms.Extensions;
public static class PluginFeatureControllerExtensions
{
public static IControlListener ApplyControlManager(this PluginFeatureController @this, string featureType, Control control)
{
return @this.ApplyControlManager(featureType, control, true, true);
}
public static IControlListener ApplyControlManager(this PluginFeatureController @this, string featureType, Control control, PluginFunctionParameter? parameter)
{
return @this.ApplyControlManager(featureType, control, true, true, parameter);
}
public static IControlListener ApplyControlManager(this PluginFeatureController @this, string featureType, Control control, bool recursive, bool autoTrack)
{
return @this.ApplyControlManager(featureType, control, recursive, autoTrack, null);
}
public static IControlListener ApplyControlManager(this PluginFeatureController @this, string featureType, Control control, bool recursive, bool autoTrack, PluginFunctionParameter? parameter)
{
var features = @this.Features.Get(featureType).OfType<ControlListenerFeature>();
if (!features.Any())
return new ControlListenerDummy([], control, recursive);
var manager = new ControlListener(features, control, recursive);
if (autoTrack)
manager.Track();
manager.Initialize(parameter);
return manager;
}
}