using Pilz.UI.Dialogs;
using Pilz.UI.Extensions;

namespace Pilz.Plugins.Advanced.UI;

public abstract class PluginModule : PluginModule<PluginModuleUI>
{
    protected PluginModule(string type, string identifier) : base(type, identifier)
    {

    }

    protected PluginModule(string type, string identifier, string? name) : base(type, identifier, name)
    {
    }

    public override void ShowUI(PluginFunctionParameter? @params)
    {
        if (CreateNewUI(@params) is PluginModuleUI ui)
        {
            ui.BackColor = Color.Transparent;
            DialogBase.Show(ui, Name!, Image!.ToIcon()!);
        }
    }
}
