From df8266fc40dec3330da079e4e5fcea327665eba7 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Mon, 10 Jun 2024 13:04:53 +0200 Subject: [PATCH] some improvements --- .../Extensions.cs | 8 +- .../Pilz.Plugins.Advanced.UI.csproj | 1 + .../Pilz.Plugins.Advanced.UI.csproj.bak | 19 +++ Pilz.Plugins.Advanced.UI/PluginModule.cs | 54 ++------ Pilz.Plugins.Advanced.UI/PluginModuleUI.cs | 11 ++ Pilz.Plugins.Advanced.UI/PluginModule{T}.cs | 56 ++++++++ Pilz.UI.Telerik.SymbolFactory/Extensions.cs | 5 - Pilz.UI/Dialogs/DialogBase.Statics.cs | 76 +++++++++++ Pilz.UI/Dialogs/DialogBase.cs | 30 +++++ Pilz.UI/Dialogs/DialogClosedEventArgs.cs | 7 + Pilz.UI/Dialogs/DialogLoadingEventArgs.cs | 7 + Pilz.UI/Dialogs/FlyoutBase.Designer.cs | 121 ++++++++++++++++++ Pilz.UI/Dialogs/FlyoutBase.cs | 89 +++++++++++++ Pilz.UI/Dialogs/FlyoutBase.resx | 120 +++++++++++++++++ Pilz.UI/Dialogs/ILoadContent.cs | 6 + Pilz.UI/Highlighter.cs | 4 +- Pilz.UI/Pilz.UI.csproj | 34 +---- Pilz.Win32/Internals/IconFactory.vb | 9 +- 18 files changed, 565 insertions(+), 92 deletions(-) create mode 100644 Pilz.Plugins.Advanced.UI/Pilz.Plugins.Advanced.UI.csproj.bak create mode 100644 Pilz.Plugins.Advanced.UI/PluginModuleUI.cs create mode 100644 Pilz.Plugins.Advanced.UI/PluginModule{T}.cs create mode 100644 Pilz.UI/Dialogs/DialogBase.Statics.cs create mode 100644 Pilz.UI/Dialogs/DialogBase.cs create mode 100644 Pilz.UI/Dialogs/DialogClosedEventArgs.cs create mode 100644 Pilz.UI/Dialogs/DialogLoadingEventArgs.cs create mode 100644 Pilz.UI/Dialogs/FlyoutBase.Designer.cs create mode 100644 Pilz.UI/Dialogs/FlyoutBase.cs create mode 100644 Pilz.UI/Dialogs/FlyoutBase.resx create mode 100644 Pilz.UI/Dialogs/ILoadContent.cs diff --git a/Pilz.Plugins.Advanced.UI.Telerik/Extensions.cs b/Pilz.Plugins.Advanced.UI.Telerik/Extensions.cs index cd23c23..7fa5b9b 100644 --- a/Pilz.Plugins.Advanced.UI.Telerik/Extensions.cs +++ b/Pilz.Plugins.Advanced.UI.Telerik/Extensions.cs @@ -63,7 +63,7 @@ public static class Extensions /// You usually don't set customClickHandler if you set this parameter to . /// Adds a custom click handler. If addDefaultHandler is true, it will only work on s.
/// You usually don't set addDefaultHandler to true if you set this parameter to something not null. - public static void InsertItemsTo(this IEnumerable features, + public static IEnumerable InsertItemsTo(this IEnumerable features, RadItemOwnerCollection itemsCollection, bool addDefaultHandler = false, EventHandler? customClickHandler = null, @@ -76,6 +76,7 @@ public static class Extensions var insertDefault = customDefault ?? (insertMode.HasFlag(FeatureInsertMode.DefaultStart) ? 0 : itemsCollection.Count); var insertTop = customTop ?? (insertMode.HasFlag(FeatureInsertMode.InsertTop) || insertMode.HasFlag(FeatureInsertMode.DefaultStart) ? 0 : insertDefault); var insertBottom = customBottom ?? (insertMode.HasFlag(FeatureInsertMode.InsertBottom) || insertMode.HasFlag(FeatureInsertMode.DefaultEnd) ? itemsCollection.Count : insertDefault); + var insertedItems = new List(); foreach (var feature in features) { @@ -112,7 +113,12 @@ public static class Extensions itemsCollection.Insert(insertBottom++, item); break; } + + if (item.Parent != null) + insertedItems.Add(item); } + + return insertedItems; } private static void RadMenuItem_RMMethod_Click(object? sender, EventArgs e) diff --git a/Pilz.Plugins.Advanced.UI/Pilz.Plugins.Advanced.UI.csproj b/Pilz.Plugins.Advanced.UI/Pilz.Plugins.Advanced.UI.csproj index d203855..046b813 100644 --- a/Pilz.Plugins.Advanced.UI/Pilz.Plugins.Advanced.UI.csproj +++ b/Pilz.Plugins.Advanced.UI/Pilz.Plugins.Advanced.UI.csproj @@ -13,6 +13,7 @@ + diff --git a/Pilz.Plugins.Advanced.UI/Pilz.Plugins.Advanced.UI.csproj.bak b/Pilz.Plugins.Advanced.UI/Pilz.Plugins.Advanced.UI.csproj.bak new file mode 100644 index 0000000..d90ec49 --- /dev/null +++ b/Pilz.Plugins.Advanced.UI/Pilz.Plugins.Advanced.UI.csproj.bak @@ -0,0 +1,19 @@ + + + + net8.0-windows + enable + enable + true + + + + 1.1.0 + + + + + + + + diff --git a/Pilz.Plugins.Advanced.UI/PluginModule.cs b/Pilz.Plugins.Advanced.UI/PluginModule.cs index 4ebc214..3d2b8a4 100644 --- a/Pilz.Plugins.Advanced.UI/PluginModule.cs +++ b/Pilz.Plugins.Advanced.UI/PluginModule.cs @@ -1,56 +1,22 @@ -using System.Reflection.Metadata; +namespace Pilz.Plugins.Advanced.UI; -namespace Pilz.Plugins.Advanced.UI; - -public abstract class PluginModule : PluginModuleBase where TPluginModuleUI : Control +public abstract class PluginModule : PluginModule { - public delegate void PluginModuleUIEventHandler(PluginModuleBase module, TPluginModuleUI ui); - - /// - /// Fires when a instance has been created. - /// - public static event PluginModuleUIEventHandler? OnUICreated; - - public bool Visible { get; set; } = true; - public bool AllowEmbedding { get; set; } = true; - - /// - /// Wrapper for the property to directly use it as . - /// - public Image? Image - { - get => base.Icon as Image; - set => base.Icon = value; - } - protected PluginModule(string moduleType, string moduleIdentifier) : base(moduleType, moduleIdentifier) { + } protected PluginModule(string moduleType, string moduleIdentifier, string moduleName) : base(moduleType, moduleIdentifier, moduleName) { } - public virtual void ShowUI() + public override void ShowUI(PluginFunctionParameter? @params) { - ShowUI(null); + if (CreateNewUI(@params) is PluginModuleUI ui) + { + ui.BackColor = Color.Transparent; + DialogBase.Show(ui, Name!, Image!.ToIcon()); + } } - - public virtual void ShowUI(PluginFunctionParameter? @params) - { - } - - public virtual TPluginModuleUI CreateUI() - { - return CreateUI(null); - } - - public virtual TPluginModuleUI CreateUI(PluginFunctionParameter? @params) - { - var ui = CreateNewUI(@params); - OnUICreated?.Invoke(this, ui); - return ui; - } - - protected abstract TPluginModuleUI CreateNewUI(PluginFunctionParameter? @params); -} \ No newline at end of file +} diff --git a/Pilz.Plugins.Advanced.UI/PluginModuleUI.cs b/Pilz.Plugins.Advanced.UI/PluginModuleUI.cs new file mode 100644 index 0000000..d96e480 --- /dev/null +++ b/Pilz.Plugins.Advanced.UI/PluginModuleUI.cs @@ -0,0 +1,11 @@ +using Pilz.UI.Dialogs; + +namespace Pilz.Plugins.Advanced.UI; + +public partial class PluginModuleUI : FlyoutBase, ILoadContent +{ + public PluginModuleUI() + { + InitializeComponent(); + } +} diff --git a/Pilz.Plugins.Advanced.UI/PluginModule{T}.cs b/Pilz.Plugins.Advanced.UI/PluginModule{T}.cs new file mode 100644 index 0000000..4ebc214 --- /dev/null +++ b/Pilz.Plugins.Advanced.UI/PluginModule{T}.cs @@ -0,0 +1,56 @@ +using System.Reflection.Metadata; + +namespace Pilz.Plugins.Advanced.UI; + +public abstract class PluginModule : PluginModuleBase where TPluginModuleUI : Control +{ + public delegate void PluginModuleUIEventHandler(PluginModuleBase module, TPluginModuleUI ui); + + /// + /// Fires when a instance has been created. + /// + public static event PluginModuleUIEventHandler? OnUICreated; + + public bool Visible { get; set; } = true; + public bool AllowEmbedding { get; set; } = true; + + /// + /// Wrapper for the property to directly use it as . + /// + public Image? Image + { + get => base.Icon as Image; + set => base.Icon = value; + } + + protected PluginModule(string moduleType, string moduleIdentifier) : base(moduleType, moduleIdentifier) + { + } + + protected PluginModule(string moduleType, string moduleIdentifier, string moduleName) : base(moduleType, moduleIdentifier, moduleName) + { + } + + public virtual void ShowUI() + { + ShowUI(null); + } + + public virtual void ShowUI(PluginFunctionParameter? @params) + { + } + + public virtual TPluginModuleUI CreateUI() + { + return CreateUI(null); + } + + public virtual TPluginModuleUI CreateUI(PluginFunctionParameter? @params) + { + var ui = CreateNewUI(@params); + OnUICreated?.Invoke(this, ui); + return ui; + } + + protected abstract TPluginModuleUI CreateNewUI(PluginFunctionParameter? @params); +} \ No newline at end of file diff --git a/Pilz.UI.Telerik.SymbolFactory/Extensions.cs b/Pilz.UI.Telerik.SymbolFactory/Extensions.cs index 5ff5524..a8a2f4e 100644 --- a/Pilz.UI.Telerik.SymbolFactory/Extensions.cs +++ b/Pilz.UI.Telerik.SymbolFactory/Extensions.cs @@ -6,11 +6,6 @@ namespace Pilz.UI.Telerik; public static class Extensions { - public static Image ToImage(this RadSvgImage svg) - { - return svg?.Document.Draw(svg.Width, svg.Height); - } - public static void ApplyColor(this RadSvgImage svg, Color color) { svg.Document.Fill = new SvgColourServer(color); diff --git a/Pilz.UI/Dialogs/DialogBase.Statics.cs b/Pilz.UI/Dialogs/DialogBase.Statics.cs new file mode 100644 index 0000000..e74b20e --- /dev/null +++ b/Pilz.UI/Dialogs/DialogBase.Statics.cs @@ -0,0 +1,76 @@ +namespace Pilz.UI.Dialogs; + +partial class DialogBase +{ + public delegate void DialogLoadingEventHandler(DialogLoadingEventArgs e); + public delegate void DialogClosedEventHandler(DialogClosedEventArgs e); + + public static event DialogLoadingEventHandler? DialogLoading; + public static event DialogClosedEventHandler? DialogClosed; + + public static T Show(string title, Icon icon, object? tag = null) where T : FlyoutBase + { + return Show(null, title, icon, tag); + } + + public static T ShowDialog(string title, Icon icon, object? tag = null) where T : FlyoutBase + { + return ShowDialog(null, title, icon, tag); + } + + public static T Show(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : FlyoutBase + { + return Show(CreatePanelInstance(tag), parent, title, icon); + } + + public static T ShowDialog(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : FlyoutBase + { + return ShowDialog(CreatePanelInstance(tag), parent, title, icon); + } + + public static T Show(T dialogPanel, string title, Icon icon) where T : FlyoutBase + { + return Show(dialogPanel, null, title, icon); + } + + public static T ShowDialog(T dialogPanel, string title, Icon icon) where T : FlyoutBase + { + return ShowDialog(dialogPanel, null, title, icon); + } + + public static T Show(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : FlyoutBase + { + CreateForm(dialogPanel, parent, title, icon).Show(); + return dialogPanel; + } + + public static T ShowDialog(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : FlyoutBase + { + CreateForm(dialogPanel, parent, title, icon).ShowDialog(); + return dialogPanel; + } + + private static T CreatePanelInstance(object? tag) where T : FlyoutBase + { + T dialogPanel = Activator.CreateInstance(); + dialogPanel.Tag = tag; + return dialogPanel; + } + + private static DialogBase CreateForm(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : FlyoutBase + { + dialogPanel.Dock = DockStyle.Fill; + + var dialog = new DialogBase(dialogPanel) + { + Text = title, + Icon = icon, + StartPosition = parent == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent, + ClientSize = dialogPanel.Size + }; + + dialog.Controls.Add(dialogPanel); + + return dialog; + } +} diff --git a/Pilz.UI/Dialogs/DialogBase.cs b/Pilz.UI/Dialogs/DialogBase.cs new file mode 100644 index 0000000..cafdd6c --- /dev/null +++ b/Pilz.UI/Dialogs/DialogBase.cs @@ -0,0 +1,30 @@ +namespace Pilz.UI.Dialogs; + +public partial class DialogBase : Form +{ + public FlyoutBase? DialogPanel { get; private set; } + + private DialogBase() + { + Load += DialogBaseForm_Load; + FormClosed += DialogBaseForm_FormClosed; + } + + public DialogBase(FlyoutBase? dialogPanel) : this() + { + DialogPanel = dialogPanel; + } + + private void DialogBaseForm_Load(object? sender, EventArgs e) + { + if (DialogPanel is ILoadContent iLoadContent) + iLoadContent.LoadContent(); + + DialogLoading?.Invoke(new DialogLoadingEventArgs(this)); + } + + private void DialogBaseForm_FormClosed(object? sender, FormClosedEventArgs e) + { + DialogClosed?.Invoke(new DialogClosedEventArgs(this)); + } +} diff --git a/Pilz.UI/Dialogs/DialogClosedEventArgs.cs b/Pilz.UI/Dialogs/DialogClosedEventArgs.cs new file mode 100644 index 0000000..77af862 --- /dev/null +++ b/Pilz.UI/Dialogs/DialogClosedEventArgs.cs @@ -0,0 +1,7 @@ +namespace Pilz.UI.Dialogs; + +public class DialogClosedEventArgs(DialogBase dialog) : EventArgs +{ + public DialogBase Parent { get; } = dialog; + public FlyoutBase? Content => Parent?.DialogPanel; +} diff --git a/Pilz.UI/Dialogs/DialogLoadingEventArgs.cs b/Pilz.UI/Dialogs/DialogLoadingEventArgs.cs new file mode 100644 index 0000000..1811e4e --- /dev/null +++ b/Pilz.UI/Dialogs/DialogLoadingEventArgs.cs @@ -0,0 +1,7 @@ +namespace Pilz.UI.Dialogs; + +public class DialogLoadingEventArgs(DialogBase dialog) : EventArgs +{ + public DialogBase Parent { get; } = dialog; + public FlyoutBase? Content => Parent?.DialogPanel; +} diff --git a/Pilz.UI/Dialogs/FlyoutBase.Designer.cs b/Pilz.UI/Dialogs/FlyoutBase.Designer.cs new file mode 100644 index 0000000..8aeb118 --- /dev/null +++ b/Pilz.UI/Dialogs/FlyoutBase.Designer.cs @@ -0,0 +1,121 @@ +namespace Pilz.UI.Dialogs; + +partial class FlyoutBase +{ + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + tableLayoutPanel_TitlePanel = new System.Windows.Forms.TableLayoutPanel(); + label_Title = new System.Windows.Forms.Label(); + tableLayoutPanel_ActionPanel = new System.Windows.Forms.TableLayoutPanel(); + button_Accept = new System.Windows.Forms.Button(); + button_Cancel = new System.Windows.Forms.Button(); + tableLayoutPanel_TitlePanel.SuspendLayout(); + tableLayoutPanel_ActionPanel.SuspendLayout(); + SuspendLayout(); + // + // tableLayoutPanel_TitlePanel + // + tableLayoutPanel_TitlePanel.ColumnCount = 1; + tableLayoutPanel_TitlePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + tableLayoutPanel_TitlePanel.Controls.Add(label_Title, 0, 0); + tableLayoutPanel_TitlePanel.Dock = System.Windows.Forms.DockStyle.Top; + tableLayoutPanel_TitlePanel.Location = new System.Drawing.Point(0, 0); + tableLayoutPanel_TitlePanel.Name = "tableLayoutPanel_TitlePanel"; + tableLayoutPanel_TitlePanel.RowCount = 1; + tableLayoutPanel_TitlePanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + tableLayoutPanel_TitlePanel.Size = new System.Drawing.Size(300, 29); + tableLayoutPanel_TitlePanel.TabIndex = 0; + // + // label_Title + // + label_Title.Dock = System.Windows.Forms.DockStyle.Fill; + label_Title.Location = new System.Drawing.Point(3, 0); + label_Title.Name = "label_Title"; + label_Title.Size = new System.Drawing.Size(294, 29); + label_Title.TabIndex = 0; + label_Title.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // tableLayoutPanel_ActionPanel + // + tableLayoutPanel_ActionPanel.AutoSize = true; + tableLayoutPanel_ActionPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + tableLayoutPanel_ActionPanel.ColumnCount = 3; + tableLayoutPanel_ActionPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + tableLayoutPanel_ActionPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + tableLayoutPanel_ActionPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + tableLayoutPanel_ActionPanel.Controls.Add(button_Cancel, 2, 0); + tableLayoutPanel_ActionPanel.Controls.Add(button_Accept, 1, 0); + tableLayoutPanel_ActionPanel.Dock = System.Windows.Forms.DockStyle.Bottom; + tableLayoutPanel_ActionPanel.Location = new System.Drawing.Point(0, 121); + tableLayoutPanel_ActionPanel.Name = "tableLayoutPanel_ActionPanel"; + tableLayoutPanel_ActionPanel.RowCount = 1; + tableLayoutPanel_ActionPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tableLayoutPanel_ActionPanel.Size = new System.Drawing.Size(300, 29); + tableLayoutPanel_ActionPanel.TabIndex = 1; + // + // button_Accept + // + button_Accept.Location = new System.Drawing.Point(141, 3); + button_Accept.Name = "button_Accept"; + button_Accept.Size = new System.Drawing.Size(75, 23); + button_Accept.TabIndex = 2; + button_Accept.Text = "Accept"; + button_Accept.UseVisualStyleBackColor = true; + button_Accept.Click += Button_Accept_Click; + // + // button_Cancel + // + button_Cancel.Location = new System.Drawing.Point(222, 3); + button_Cancel.Name = "button_Cancel"; + button_Cancel.Size = new System.Drawing.Size(75, 23); + button_Cancel.TabIndex = 3; + button_Cancel.Text = "Cancel"; + button_Cancel.UseVisualStyleBackColor = true; + button_Cancel.Click += Button_Cancel_Click; + // + // FlyoutBase + // + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + Controls.Add(tableLayoutPanel_ActionPanel); + Controls.Add(tableLayoutPanel_TitlePanel); + Name = "FlyoutBase"; + Size = new System.Drawing.Size(300, 150); + tableLayoutPanel_TitlePanel.ResumeLayout(false); + tableLayoutPanel_ActionPanel.ResumeLayout(false); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_TitlePanel; + private System.Windows.Forms.Label label_Title; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_ActionPanel; + private System.Windows.Forms.Button button_Cancel; + private System.Windows.Forms.Button button_Accept; +} diff --git a/Pilz.UI/Dialogs/FlyoutBase.cs b/Pilz.UI/Dialogs/FlyoutBase.cs new file mode 100644 index 0000000..08eecb6 --- /dev/null +++ b/Pilz.UI/Dialogs/FlyoutBase.cs @@ -0,0 +1,89 @@ +namespace Pilz.UI.Dialogs; + +public partial class FlyoutBase : UserControl +{ + public DialogResult Result { get; protected set; } + public bool RegisterDialogAccept { get; set; } = true; + public bool RegisterDialogCancel { get; set; } = false; + + protected bool ActionPanelVisible + { + get => tableLayoutPanel_ActionPanel.Visible; + set => tableLayoutPanel_ActionPanel.Visible = value; + } + + protected bool CancelButtonVisible + { + get => button_Cancel.Visible; + set => button_Cancel.Visible = value; + } + + protected bool CancelButtonEnable + { + get => button_Cancel.Enabled; + set => button_Cancel.Enabled = value; + } + + protected bool ConfirmButtonEnable + { + get => button_Accept.Enabled; + set => button_Accept.Enabled = value; + } + + public string Title + { + get => label_Title.Text; + set + { + label_Title.Text = value; + SetShowTitlePanel(); + } + } + + public FlyoutBase() + { + InitializeComponent(); + ParentChanged += FlyoutBase_ParentChanged; ; + } + + private void FlyoutBase_ParentChanged(object sender, System.EventArgs e) + { + var frm = FindForm(); + if (frm != null) + { + if (RegisterDialogAccept) + frm.AcceptButton = button_Accept; + if (RegisterDialogCancel) + frm.CancelButton = button_Cancel; + } + } + + protected void Close(DialogResult result) + { + Result = result; + + if (FindForm() is DialogBase dialogForm) + dialogForm.Close(); + } + + protected virtual bool ValidateOK() + { + return true; + } + + private void SetShowTitlePanel() + { + tableLayoutPanel_TitlePanel.Visible = !string.IsNullOrWhiteSpace(label_Title.Text); + } + + private void Button_Accept_Click(object sender, System.EventArgs e) + { + if (ValidateOK()) + Close(DialogResult.OK); + } + + private void Button_Cancel_Click(object sender, System.EventArgs e) + { + Close(DialogResult.Cancel); + } +} diff --git a/Pilz.UI/Dialogs/FlyoutBase.resx b/Pilz.UI/Dialogs/FlyoutBase.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/Pilz.UI/Dialogs/FlyoutBase.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Pilz.UI/Dialogs/ILoadContent.cs b/Pilz.UI/Dialogs/ILoadContent.cs new file mode 100644 index 0000000..26f841f --- /dev/null +++ b/Pilz.UI/Dialogs/ILoadContent.cs @@ -0,0 +1,6 @@ +namespace Pilz.UI.Dialogs; + +public interface ILoadContent +{ + void LoadContent(); +} diff --git a/Pilz.UI/Highlighter.cs b/Pilz.UI/Highlighter.cs index f428f17..d55bbb0 100644 --- a/Pilz.UI/Highlighter.cs +++ b/Pilz.UI/Highlighter.cs @@ -442,7 +442,7 @@ public class Highlighter : Component } } - private Timer _DelayTimer = null; + private System.Windows.Forms.Timer _DelayTimer = null; private void ContainerControlSizeChanged(object sender, EventArgs e) { @@ -453,7 +453,7 @@ public class Highlighter : Component if (_DelayTimer is null) { - _DelayTimer = new Timer(); + _DelayTimer = new(); _DelayTimer.Interval = 100; _DelayTimer.Tick += new EventHandler(DelayTimerTick); _DelayTimer.Start(); diff --git a/Pilz.UI/Pilz.UI.csproj b/Pilz.UI/Pilz.UI.csproj index 28bf18e..bbf97ac 100644 --- a/Pilz.UI/Pilz.UI.csproj +++ b/Pilz.UI/Pilz.UI.csproj @@ -1,42 +1,12 @@  Windows - net6.0-windows;net8.0-windows - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + net8.0-windows Pilz.UI.xml true $(DefaultItemExcludes);$(ProjectDir)**\*.vb latest - TRACE - - - DEBUG - - - true - - - On - - - Binary - - - Off - - - On - - - bin\$(Platform)\$(Configuration)\ - MinimumRecommendedRules.ruleset - true - DEBUG - - - bin\$(Platform)\$(Configuration)\ - true - MinimumRecommendedRules.ruleset + enable 2.0.0 diff --git a/Pilz.Win32/Internals/IconFactory.vb b/Pilz.Win32/Internals/IconFactory.vb index d0eeaa9..6892ae2 100644 --- a/Pilz.Win32/Internals/IconFactory.vb +++ b/Pilz.Win32/Internals/IconFactory.vb @@ -1,11 +1,4 @@ -' Nicht gemergte Änderung aus Projekt "Pilz.Win32 (net6.0-windows)" -' Vor: -' Imports System.Runtime.InteropServices -' Imports Microsoft.Win32 -' Nach: -' Imports System.Collections.Generic -' Imports System.Drawing -.Drawing +Imports System.Drawing Imports System.Reflection Imports System.Runtime.InteropServices