From 9e8ca9140f86e316ec5803113503179987a0a9b2 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Mon, 10 Jun 2024 09:48:53 +0200 Subject: [PATCH] prefix Telerik-based type names with "Rad" --- .../Extensions.cs | 12 ++++++++-- .../Pilz.Plugins.Advanced.UI.Telerik.csproj | 2 +- .../{PluginModule.cs => RadPluginModule.cs} | 10 ++++---- ...PluginModuleUI.cs => RadPluginModuleUI.cs} | 6 ++--- .../Dialogs/DialogClosedEventArgs.cs | 6 ++--- .../Dialogs/DialogLoadingEventArgs.cs | 6 ++--- .../Dialogs/FlyoutClosedEventArgs.cs | 4 ++-- .../Dialogs/FlyoutCreatedEventArgs.cs | 4 ++-- ...se.Statics.cs => RadDialogBase.Statics.cs} | 24 +++++++++---------- .../{DialogBase.cs => RadDialogBase.cs} | 8 +++---- ....Designer.cs => RadFlyoutBase.Designer.cs} | 4 ++-- ...se.Statics.cs => RadFlyoutBase.Statics.cs} | 12 +++++----- .../{FlyoutBase.cs => RadFlyoutBase.cs} | 6 ++--- .../{FlyoutBase.resx => RadFlyoutBase.resx} | 0 14 files changed, 56 insertions(+), 48 deletions(-) rename Pilz.Plugins.Advanced.UI.Telerik/{PluginModule.cs => RadPluginModule.cs} (55%) rename Pilz.Plugins.Advanced.UI.Telerik/{PluginModuleUI.cs => RadPluginModuleUI.cs} (66%) rename Pilz.UI.Telerik/Dialogs/{DialogBase.Statics.cs => RadDialogBase.Statics.cs} (77%) rename Pilz.UI.Telerik/Dialogs/{DialogBase.cs => RadDialogBase.cs} (76%) rename Pilz.UI.Telerik/Dialogs/{FlyoutBase.Designer.cs => RadFlyoutBase.Designer.cs} (98%) rename Pilz.UI.Telerik/Dialogs/{FlyoutBase.Statics.cs => RadFlyoutBase.Statics.cs} (89%) rename Pilz.UI.Telerik/Dialogs/{FlyoutBase.cs => RadFlyoutBase.cs} (93%) rename Pilz.UI.Telerik/Dialogs/{FlyoutBase.resx => RadFlyoutBase.resx} (100%) diff --git a/Pilz.Plugins.Advanced.UI.Telerik/Extensions.cs b/Pilz.Plugins.Advanced.UI.Telerik/Extensions.cs index 50d2dde..cd23c23 100644 --- a/Pilz.Plugins.Advanced.UI.Telerik/Extensions.cs +++ b/Pilz.Plugins.Advanced.UI.Telerik/Extensions.cs @@ -63,7 +63,15 @@ 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, RadItemOwnerCollection itemsCollection, bool addDefaultHandler = false, EventHandler? customClickHandler = null, FeatureInsertMode insertMode = FeatureInsertMode.Default, int? customDefault = null, int? customTop = null, int? customBottom = null, FeatureInsertPosition insertSplitter = FeatureInsertPosition.None) + public static void InsertItemsTo(this IEnumerable features, + RadItemOwnerCollection itemsCollection, + bool addDefaultHandler = false, + EventHandler? customClickHandler = null, + FeatureInsertMode insertMode = FeatureInsertMode.Default, + int? customDefault = null, + int? customTop = null, + int? customBottom = null, + FeatureInsertPosition insertSplitter = FeatureInsertPosition.None) { var insertDefault = customDefault ?? (insertMode.HasFlag(FeatureInsertMode.DefaultStart) ? 0 : itemsCollection.Count); var insertTop = customTop ?? (insertMode.HasFlag(FeatureInsertMode.InsertTop) || insertMode.HasFlag(FeatureInsertMode.DefaultStart) ? 0 : insertDefault); @@ -109,7 +117,7 @@ public static class Extensions private static void RadMenuItem_RMMethod_Click(object? sender, EventArgs e) { - if (sender is RadMenuItem item && item.Tag is PluginModule function) + if (sender is RadMenuItem item && item.Tag is RadPluginModule function) function.ShowUI(); } diff --git a/Pilz.Plugins.Advanced.UI.Telerik/Pilz.Plugins.Advanced.UI.Telerik.csproj b/Pilz.Plugins.Advanced.UI.Telerik/Pilz.Plugins.Advanced.UI.Telerik.csproj index a5618de..1e9c36e 100644 --- a/Pilz.Plugins.Advanced.UI.Telerik/Pilz.Plugins.Advanced.UI.Telerik.csproj +++ b/Pilz.Plugins.Advanced.UI.Telerik/Pilz.Plugins.Advanced.UI.Telerik.csproj @@ -24,7 +24,7 @@ - + UserControl diff --git a/Pilz.Plugins.Advanced.UI.Telerik/PluginModule.cs b/Pilz.Plugins.Advanced.UI.Telerik/RadPluginModule.cs similarity index 55% rename from Pilz.Plugins.Advanced.UI.Telerik/PluginModule.cs rename to Pilz.Plugins.Advanced.UI.Telerik/RadPluginModule.cs index a54ebb5..ff03678 100644 --- a/Pilz.Plugins.Advanced.UI.Telerik/PluginModule.cs +++ b/Pilz.Plugins.Advanced.UI.Telerik/RadPluginModule.cs @@ -4,7 +4,7 @@ using Telerik.WinControls; namespace Pilz.Plugins.Advanced.UI.Telerik; -public abstract class PluginModule : PluginModule +public abstract class RadPluginModule : PluginModule { /// /// Wrapper for the property to directly use it as . @@ -15,21 +15,21 @@ public abstract class PluginModule : PluginModule set => base.Icon = value; } - protected PluginModule(string moduleType, string moduleIdentifier) : base(moduleType, moduleIdentifier) + protected RadPluginModule(string moduleType, string moduleIdentifier) : base(moduleType, moduleIdentifier) { } - protected PluginModule(string moduleType, string moduleIdentifier, string moduleName) : base(moduleType, moduleIdentifier, moduleName) + protected RadPluginModule(string moduleType, string moduleIdentifier, string moduleName) : base(moduleType, moduleIdentifier, moduleName) { } public override void ShowUI(PluginFunctionParameter? @params) { - if (CreateNewUI(@params) is PluginModuleUI ui) + if (CreateNewUI(@params) is RadPluginModuleUI ui) { ui.BackColor = Color.Transparent; - DialogBase.Show(ui, Name!, SvgImage!.ToImage().ToIcon()!); + RadDialogBase.Show(ui, Name!, SvgImage!.ToImage().ToIcon()!); } } } \ No newline at end of file diff --git a/Pilz.Plugins.Advanced.UI.Telerik/PluginModuleUI.cs b/Pilz.Plugins.Advanced.UI.Telerik/RadPluginModuleUI.cs similarity index 66% rename from Pilz.Plugins.Advanced.UI.Telerik/PluginModuleUI.cs rename to Pilz.Plugins.Advanced.UI.Telerik/RadPluginModuleUI.cs index 53f83ca..4fa576f 100644 --- a/Pilz.Plugins.Advanced.UI.Telerik/PluginModuleUI.cs +++ b/Pilz.Plugins.Advanced.UI.Telerik/RadPluginModuleUI.cs @@ -2,9 +2,9 @@ namespace Pilz.Plugins.Advanced.UI.Telerik; -public class PluginModuleUI : FlyoutBase, ILoadContent +public class RadPluginModuleUI : RadFlyoutBase, ILoadContent { - public PluginModuleUI() + public RadPluginModuleUI() { ActionPanelVisible = false; } @@ -12,4 +12,4 @@ public class PluginModuleUI : FlyoutBase, ILoadContent public virtual void LoadContent() { } -} +} \ No newline at end of file diff --git a/Pilz.UI.Telerik/Dialogs/DialogClosedEventArgs.cs b/Pilz.UI.Telerik/Dialogs/DialogClosedEventArgs.cs index 39ec11d..0f67c13 100644 --- a/Pilz.UI.Telerik/Dialogs/DialogClosedEventArgs.cs +++ b/Pilz.UI.Telerik/Dialogs/DialogClosedEventArgs.cs @@ -2,10 +2,10 @@ public class DialogClosedEventArgs : EventArgs { - public DialogBase Parent { get; private set; } - public FlyoutBase? Content => Parent?.DialogPanel; + public RadDialogBase Parent { get; private set; } + public RadFlyoutBase? Content => Parent?.DialogPanel; - public DialogClosedEventArgs(DialogBase dialog) + public DialogClosedEventArgs(RadDialogBase dialog) { Parent = dialog; } diff --git a/Pilz.UI.Telerik/Dialogs/DialogLoadingEventArgs.cs b/Pilz.UI.Telerik/Dialogs/DialogLoadingEventArgs.cs index fefcec0..bd68b7d 100644 --- a/Pilz.UI.Telerik/Dialogs/DialogLoadingEventArgs.cs +++ b/Pilz.UI.Telerik/Dialogs/DialogLoadingEventArgs.cs @@ -2,10 +2,10 @@ public class DialogLoadingEventArgs : EventArgs { - public DialogBase Parent { get; private set; } - public FlyoutBase? Content => Parent?.DialogPanel; + public RadDialogBase Parent { get; private set; } + public RadFlyoutBase? Content => Parent?.DialogPanel; - public DialogLoadingEventArgs(DialogBase dialog) + public DialogLoadingEventArgs(RadDialogBase dialog) { Parent = dialog; } diff --git a/Pilz.UI.Telerik/Dialogs/FlyoutClosedEventArgs.cs b/Pilz.UI.Telerik/Dialogs/FlyoutClosedEventArgs.cs index dcf3ecd..d8577bc 100644 --- a/Pilz.UI.Telerik/Dialogs/FlyoutClosedEventArgs.cs +++ b/Pilz.UI.Telerik/Dialogs/FlyoutClosedEventArgs.cs @@ -2,9 +2,9 @@ public class FlyoutClosedEventArgs : global::Telerik.WinControls.UI.SplashScreen.FlyoutClosedEventArgs { - public new FlyoutBase? Content => base.Content as FlyoutBase; + public new RadFlyoutBase? Content => base.Content as RadFlyoutBase; - public FlyoutClosedEventArgs(FlyoutBase content) : base(content) + public FlyoutClosedEventArgs(RadFlyoutBase content) : base(content) { } } diff --git a/Pilz.UI.Telerik/Dialogs/FlyoutCreatedEventArgs.cs b/Pilz.UI.Telerik/Dialogs/FlyoutCreatedEventArgs.cs index fdcdcdd..e41ad82 100644 --- a/Pilz.UI.Telerik/Dialogs/FlyoutCreatedEventArgs.cs +++ b/Pilz.UI.Telerik/Dialogs/FlyoutCreatedEventArgs.cs @@ -4,9 +4,9 @@ namespace Pilz.UI.Telerik.Dialogs; public class FlyoutCreatedEventArgs : ContentCreatedEventArgs { - public new FlyoutBase? Content => base.Content as FlyoutBase; + public new RadFlyoutBase? Content => base.Content as RadFlyoutBase; - public FlyoutCreatedEventArgs(FlyoutBase content) : base(content) + public FlyoutCreatedEventArgs(RadFlyoutBase content) : base(content) { } } diff --git a/Pilz.UI.Telerik/Dialogs/DialogBase.Statics.cs b/Pilz.UI.Telerik/Dialogs/RadDialogBase.Statics.cs similarity index 77% rename from Pilz.UI.Telerik/Dialogs/DialogBase.Statics.cs rename to Pilz.UI.Telerik/Dialogs/RadDialogBase.Statics.cs index f2d78ce..3e021ba 100644 --- a/Pilz.UI.Telerik/Dialogs/DialogBase.Statics.cs +++ b/Pilz.UI.Telerik/Dialogs/RadDialogBase.Statics.cs @@ -1,6 +1,6 @@ namespace Pilz.UI.Telerik.Dialogs; -partial class DialogBase +partial class RadDialogBase { public delegate void DialogLoadingEventHandler(DialogLoadingEventArgs e); public delegate void DialogClosedEventHandler(DialogClosedEventArgs e); @@ -8,60 +8,60 @@ partial class DialogBase public static event DialogLoadingEventHandler? DialogLoading; public static event DialogClosedEventHandler? DialogClosed; - public static T Show(string title, Icon icon, object? tag = null) where T : FlyoutBase + public static T Show(string title, Icon icon, object? tag = null) where T : RadFlyoutBase { return Show(null, title, icon, tag); } - public static T ShowDialog(string title, Icon icon, object? tag = null) where T : FlyoutBase + public static T ShowDialog(string title, Icon icon, object? tag = null) where T : RadFlyoutBase { return ShowDialog(null, title, icon, tag); } - public static T Show(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : FlyoutBase + public static T Show(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : RadFlyoutBase { return Show(CreatePanelInstance(tag), parent, title, icon); } - public static T ShowDialog(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : FlyoutBase + public static T ShowDialog(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : RadFlyoutBase { return ShowDialog(CreatePanelInstance(tag), parent, title, icon); } - public static T Show(T dialogPanel, string title, Icon icon) where T : FlyoutBase + public static T Show(T dialogPanel, string title, Icon icon) where T : RadFlyoutBase { return Show(dialogPanel, null, title, icon); } - public static T ShowDialog(T dialogPanel, string title, Icon icon) where T : FlyoutBase + public static T ShowDialog(T dialogPanel, string title, Icon icon) where T : RadFlyoutBase { return ShowDialog(dialogPanel, null, title, icon); } - public static T Show(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : FlyoutBase + public static T Show(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : RadFlyoutBase { CreateForm(dialogPanel, parent, title, icon).Show(); return dialogPanel; } - public static T ShowDialog(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : FlyoutBase + public static T ShowDialog(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : RadFlyoutBase { CreateForm(dialogPanel, parent, title, icon).ShowDialog(); return dialogPanel; } - private static T CreatePanelInstance(object? tag) where T : FlyoutBase + private static T CreatePanelInstance(object? tag) where T : RadFlyoutBase { T dialogPanel = Activator.CreateInstance(); dialogPanel.Tag = tag; return dialogPanel; } - private static DialogBase CreateForm(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : FlyoutBase + private static RadDialogBase CreateForm(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : RadFlyoutBase { dialogPanel.Dock = DockStyle.Fill; - var dialog = new DialogBase(dialogPanel) + var dialog = new RadDialogBase(dialogPanel) { Text = title, Icon = icon, diff --git a/Pilz.UI.Telerik/Dialogs/DialogBase.cs b/Pilz.UI.Telerik/Dialogs/RadDialogBase.cs similarity index 76% rename from Pilz.UI.Telerik/Dialogs/DialogBase.cs rename to Pilz.UI.Telerik/Dialogs/RadDialogBase.cs index a4a723f..2950bde 100644 --- a/Pilz.UI.Telerik/Dialogs/DialogBase.cs +++ b/Pilz.UI.Telerik/Dialogs/RadDialogBase.cs @@ -2,17 +2,17 @@ namespace Pilz.UI.Telerik.Dialogs; -public partial class DialogBase : RadForm +public partial class RadDialogBase : RadForm { - public FlyoutBase? DialogPanel { get; private set; } + public RadFlyoutBase? DialogPanel { get; private set; } - private DialogBase() + private RadDialogBase() { Load += DialogBaseForm_Load; FormClosed += DialogBaseForm_FormClosed; } - public DialogBase(FlyoutBase? dialogPanel) : this() + public RadDialogBase(RadFlyoutBase? dialogPanel) : this() { DialogPanel = dialogPanel; } diff --git a/Pilz.UI.Telerik/Dialogs/FlyoutBase.Designer.cs b/Pilz.UI.Telerik/Dialogs/RadFlyoutBase.Designer.cs similarity index 98% rename from Pilz.UI.Telerik/Dialogs/FlyoutBase.Designer.cs rename to Pilz.UI.Telerik/Dialogs/RadFlyoutBase.Designer.cs index 4616c92..93650cc 100644 --- a/Pilz.UI.Telerik/Dialogs/FlyoutBase.Designer.cs +++ b/Pilz.UI.Telerik/Dialogs/RadFlyoutBase.Designer.cs @@ -1,6 +1,6 @@ namespace Pilz.UI.Telerik.Dialogs { - partial class FlyoutBase + partial class RadFlyoutBase { /// /// Erforderliche Designervariable. @@ -28,7 +28,7 @@ /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FlyoutBase)); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RadFlyoutBase)); radButton_Cancel = new global::Telerik.WinControls.UI.RadButton(); radButton_Confirm = new global::Telerik.WinControls.UI.RadButton(); tableLayoutPanel_ActionButtons = new TableLayoutPanel(); diff --git a/Pilz.UI.Telerik/Dialogs/FlyoutBase.Statics.cs b/Pilz.UI.Telerik/Dialogs/RadFlyoutBase.Statics.cs similarity index 89% rename from Pilz.UI.Telerik/Dialogs/FlyoutBase.Statics.cs rename to Pilz.UI.Telerik/Dialogs/RadFlyoutBase.Statics.cs index 5a1d80a..9aff04f 100644 --- a/Pilz.UI.Telerik/Dialogs/FlyoutBase.Statics.cs +++ b/Pilz.UI.Telerik/Dialogs/RadFlyoutBase.Statics.cs @@ -3,7 +3,7 @@ using Telerik.WinControls.UI.SplashScreen; namespace Pilz.UI.Telerik.Dialogs; -partial class FlyoutBase +partial class RadFlyoutBase { public delegate void FlyoutCreatedEventHandler(FlyoutCreatedEventArgs e); public delegate void FlyoutClosedEventHandler(FlyoutClosedEventArgs e); @@ -26,7 +26,7 @@ partial class FlyoutBase private static object? tagToAssign = null; public static Control? ParentContext { get; private set; } = null; - static FlyoutBase() + static RadFlyoutBase() { RadFlyoutManager.ContentCreated += RadFlyoutManager_ContentCreated; RadFlyoutManager.FlyoutClosed += RadFlyoutManager_FlyoutClosed; @@ -34,12 +34,12 @@ partial class FlyoutBase private static void RadFlyoutManager_ContentCreated(ContentCreatedEventArgs e) { - if (e.Content is FlyoutBase dialogBase) + if (e.Content is RadFlyoutBase dialogBase) { if (tagToAssign != null) dialogBase.Tag = tagToAssign; - var eventArgs = new FlyoutCreatedEventArgs((FlyoutBase)e.Content); + var eventArgs = new FlyoutCreatedEventArgs((RadFlyoutBase)e.Content); if (dialogBase is ILoadContent iLoadContent) iLoadContent.LoadContent(); @@ -56,9 +56,9 @@ partial class FlyoutBase private static void RadFlyoutManager_FlyoutClosed(global::Telerik.WinControls.UI.SplashScreen.FlyoutClosedEventArgs e) { - if (e.Content is FlyoutBase dialogBase) + if (e.Content is RadFlyoutBase dialogBase) { - var eventArgs = new FlyoutClosedEventArgs((FlyoutBase)e.Content); + var eventArgs = new FlyoutClosedEventArgs((RadFlyoutBase)e.Content); foreach (var args in flyoutCloseHandlers) { diff --git a/Pilz.UI.Telerik/Dialogs/FlyoutBase.cs b/Pilz.UI.Telerik/Dialogs/RadFlyoutBase.cs similarity index 93% rename from Pilz.UI.Telerik/Dialogs/FlyoutBase.cs rename to Pilz.UI.Telerik/Dialogs/RadFlyoutBase.cs index 6ca0e61..731c0e1 100644 --- a/Pilz.UI.Telerik/Dialogs/FlyoutBase.cs +++ b/Pilz.UI.Telerik/Dialogs/RadFlyoutBase.cs @@ -2,7 +2,7 @@ namespace Pilz.UI.Telerik.Dialogs; -public partial class FlyoutBase : UserControl +public partial class RadFlyoutBase : UserControl { public static RadSvgImage? CancelSvg { get; set; } = null; public static RadSvgImage? ConfirmSvg { get; set; } = null; @@ -35,7 +35,7 @@ public partial class FlyoutBase : UserControl set => radButton_Confirm.Enabled = value; } - protected FlyoutBase() + protected RadFlyoutBase() { InitializeComponent(); ParentChanged += FlyoutDialogBase_ParentChanged; @@ -61,7 +61,7 @@ public partial class FlyoutBase : UserControl { Result = result; - if (FindForm() is DialogBase dialogForm) + if (FindForm() is RadDialogBase dialogForm) dialogForm.Close(); else CloseFlyout(); diff --git a/Pilz.UI.Telerik/Dialogs/FlyoutBase.resx b/Pilz.UI.Telerik/Dialogs/RadFlyoutBase.resx similarity index 100% rename from Pilz.UI.Telerik/Dialogs/FlyoutBase.resx rename to Pilz.UI.Telerik/Dialogs/RadFlyoutBase.resx