34 lines
890 B
C#
34 lines
890 B
C#
using Pilz.UI.Telerik;
|
|
using Pilz.UI.Telerik.Dialogs;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using Telerik.WinControls;
|
|
|
|
namespace Pilz.Plugins.Advanced
|
|
{
|
|
public abstract class PluginModule : PluginFeature
|
|
{
|
|
public bool Visible { get; set; } = true;
|
|
public bool AllowEmbedding { get; set; } = true;
|
|
|
|
protected PluginModule(string moduleType, string moduleName) : base(moduleType, moduleName)
|
|
{
|
|
}
|
|
|
|
public virtual void ShowUI()
|
|
{
|
|
if (CreateNewUI() is PluginModuleUI ui)
|
|
{
|
|
ui.BackColor = Color.Transparent;
|
|
DialogBaseForm.Show(ui, Name!, Icon!.ToImage().ToIcon()!);
|
|
}
|
|
}
|
|
|
|
public virtual PluginModuleUI CreateUI()
|
|
{
|
|
return CreateNewUI();
|
|
}
|
|
|
|
protected abstract PluginModuleUI CreateNewUI();
|
|
}
|
|
} |