parameter for PluginModule
This commit is contained in:
@@ -24,9 +24,9 @@ public abstract class PluginModule : PluginModule<PluginModuleUI>
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ShowUI()
|
public override void ShowUI(PluginFunctionParameter parameter)
|
||||||
{
|
{
|
||||||
if (CreateNewUI() is PluginModuleUI ui)
|
if (CreateNewUI(parameter) is PluginModuleUI ui)
|
||||||
{
|
{
|
||||||
ui.BackColor = Color.Transparent;
|
ui.BackColor = Color.Transparent;
|
||||||
DialogBase.Show(ui, Name!, SvgImage!.ToImage().ToIcon()!);
|
DialogBase.Show(ui, Name!, SvgImage!.ToImage().ToIcon()!);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace Pilz.Plugins.Advanced.UI;
|
using System.Reflection.Metadata;
|
||||||
|
|
||||||
|
namespace Pilz.Plugins.Advanced.UI;
|
||||||
|
|
||||||
public abstract class PluginModule<TPluginModuleUI> : PluginModuleBase where TPluginModuleUI : Control
|
public abstract class PluginModule<TPluginModuleUI> : PluginModuleBase where TPluginModuleUI : Control
|
||||||
{
|
{
|
||||||
@@ -29,16 +31,16 @@ public abstract class PluginModule<TPluginModuleUI> : PluginModuleBase where TPl
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void ShowUI()
|
public virtual void ShowUI(PluginFunctionParameter parameter)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual TPluginModuleUI CreateUI()
|
public virtual TPluginModuleUI CreateUI(PluginFunctionParameter parameter)
|
||||||
{
|
{
|
||||||
var ui = CreateNewUI();
|
var ui = CreateNewUI(parameter);
|
||||||
OnUICreated?.Invoke(this, ui);
|
OnUICreated?.Invoke(this, ui);
|
||||||
return ui;
|
return ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract TPluginModuleUI CreateNewUI();
|
protected abstract TPluginModuleUI CreateNewUI(PluginFunctionParameter parameter);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user