version bump

This commit is contained in:
Pilzinsel64
2024-11-15 10:17:50 +01:00
parent 7c39f2778f
commit b7acc6f0a4
5 changed files with 93 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
using System.Windows.Forms;
namespace Pilz.Plugins.Advanced.UI.Extensions;
public static class ControlFeatureCollectoinExtensions
{
public static void ExecuteControlFeatures(this IEnumerable<ControlFeature> @this, Control control, bool recursive, PluginFunctionParameter? parameter)
{
if (control.Name is string name)
{
foreach (var feature in @this)
{
if (feature.ControlName is null || feature.ControlName.Equals(control.Name))
feature.Execute(control, parameter);
}
}
if (recursive)
{
foreach (var child in control.Controls)
{
if (child is Control childControl)
ExecuteControlFeatures(@this, childControl, true, parameter);
}
}
}
}

View File

@@ -0,0 +1,30 @@
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);
}
}
}
}
}