change UI to UI.WinForms
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user