PluginFeature

This commit is contained in:
2023-12-05 13:52:35 +01:00
parent 066d5a1a81
commit 0ecbde3fd7
7 changed files with 164 additions and 126 deletions

View File

@@ -6,19 +6,13 @@ using Telerik.WinControls;
namespace Pilz.Plugins.Advanced
{
public abstract class PluginModule
public abstract class PluginModule : PluginFeature
{
public string Type { get; init; }
public string Name { get; init; }
public RadSvgImage? Icon { get; set; }
public bool Visible { get; set; } = true;
public bool RequiresRomManager { get; set; } = true;
public bool AllowEmbedding { get; set; } = true;
protected PluginModule(string moduleType, string moduleName)
protected PluginModule(string moduleType, string moduleName) : base(moduleType, moduleName)
{
Type = moduleType;
Name = moduleName;
}
public virtual void ShowUI()
@@ -26,11 +20,11 @@ namespace Pilz.Plugins.Advanced
if (CreateNewUI() is PluginModuleUI ui)
{
ui.BackColor = Color.Transparent;
DialogBaseForm.Show(ui, Name, Icon!.ToImage().ToIcon()!);
DialogBaseForm.Show(ui, Name!, Icon!.ToImage().ToIcon()!);
}
}
public PluginModuleUI CreateUI()
public virtual PluginModuleUI CreateUI()
{
return CreateNewUI();
}