code optimization

This commit is contained in:
2024-06-05 19:15:32 +02:00
parent d4be7d0566
commit 1b49c54822
151 changed files with 4124 additions and 4673 deletions

View File

@@ -1,39 +1,35 @@
using Pilz.Plugins.Advanced.UI;
using Pilz.UI.Telerik;
using Pilz.UI.Telerik;
using Pilz.UI.Telerik.Dialogs;
using System.Drawing;
using System.Windows.Forms;
using Telerik.WinControls;
namespace Pilz.Plugins.Advanced.UI.Telerik
namespace Pilz.Plugins.Advanced.UI.Telerik;
public abstract class PluginModule : PluginModule<PluginModuleUI>
{
public abstract class PluginModule : PluginModule<PluginModuleUI>
/// <summary>
/// Wrapper for the <see cref="PluginFeature.Icon"/> property to directly use it as <see cref="RadSvgImage"/>.
/// </summary>
public RadSvgImage? SvgImage
{
/// <summary>
/// Wrapper for the <see cref="PluginFeature.Icon"/> property to directly use it as <see cref="RadSvgImage"/>.
/// </summary>
public RadSvgImage? SvgImage
{
get => base.Icon as RadSvgImage;
set => base.Icon = value;
}
get => base.Icon as RadSvgImage;
set => base.Icon = value;
}
protected PluginModule(string moduleType, string moduleIdentifier) : base(moduleType, moduleIdentifier)
{
protected PluginModule(string moduleType, string moduleIdentifier) : base(moduleType, moduleIdentifier)
{
}
}
protected PluginModule(string moduleType, string moduleIdentifier, string moduleName) : base(moduleType, moduleIdentifier, moduleName)
{
}
protected PluginModule(string moduleType, string moduleIdentifier, string moduleName) : base(moduleType, moduleIdentifier, moduleName)
{
}
public override void ShowUI()
public override void ShowUI()
{
if (CreateNewUI() is PluginModuleUI ui)
{
if (CreateNewUI() is PluginModuleUI ui)
{
ui.BackColor = Color.Transparent;
DialogBase.Show(ui, Name!, SvgImage!.ToImage().ToIcon()!);
}
ui.BackColor = Color.Transparent;
DialogBase.Show(ui, Name!, SvgImage!.ToImage().ToIcon()!);
}
}
}