event for ui creation
This commit is contained in:
@@ -8,6 +8,13 @@ namespace Pilz.Plugins.Advanced
|
|||||||
{
|
{
|
||||||
public abstract class PluginModule : PluginFeature
|
public abstract class PluginModule : PluginFeature
|
||||||
{
|
{
|
||||||
|
public delegate void PluginModuleUIEventHandler(PluginModule module, PluginModuleUI ui);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fires when a <see cref="PluginModuleUI"/> instance has been created.
|
||||||
|
/// </summary>
|
||||||
|
public static event PluginModuleUIEventHandler? OnUICreated;
|
||||||
|
|
||||||
public bool Visible { get; set; } = true;
|
public bool Visible { get; set; } = true;
|
||||||
public bool AllowEmbedding { get; set; } = true;
|
public bool AllowEmbedding { get; set; } = true;
|
||||||
|
|
||||||
@@ -26,7 +33,9 @@ namespace Pilz.Plugins.Advanced
|
|||||||
|
|
||||||
public virtual PluginModuleUI CreateUI()
|
public virtual PluginModuleUI CreateUI()
|
||||||
{
|
{
|
||||||
return CreateNewUI();
|
var ui = CreateNewUI();
|
||||||
|
OnUICreated?.Invoke(this, ui);
|
||||||
|
return ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract PluginModuleUI CreateNewUI();
|
protected abstract PluginModuleUI CreateNewUI();
|
||||||
|
|||||||
Reference in New Issue
Block a user