prefix Telerik-based type names with "Rad"
This commit is contained in:
@@ -63,7 +63,15 @@ public static class Extensions
|
||||
/// You usually don't set customClickHandler if you set this parameter to <see cref="true"/>.</param>
|
||||
/// <param name="customClickHandler">Adds a custom click handler. If addDefaultHandler is true, it will only work on <see cref="PluginFeature"/>s.<br/>
|
||||
/// You usually don't set addDefaultHandler to true if you set this parameter to something not null.</param>
|
||||
public static void InsertItemsTo(this IEnumerable<PluginFeature> 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<PluginFeature> 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();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="PluginModuleUI.cs">
|
||||
<Compile Update="RadPluginModuleUI.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -4,7 +4,7 @@ using Telerik.WinControls;
|
||||
|
||||
namespace Pilz.Plugins.Advanced.UI.Telerik;
|
||||
|
||||
public abstract class PluginModule : PluginModule<PluginModuleUI>
|
||||
public abstract class RadPluginModule : PluginModule<RadPluginModuleUI>
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper for the <see cref="PluginFeature.Icon"/> property to directly use it as <see cref="RadSvgImage"/>.
|
||||
@@ -15,21 +15,21 @@ public abstract class PluginModule : PluginModule<PluginModuleUI>
|
||||
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()!);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<T>(string title, Icon icon, object? tag = null) where T : FlyoutBase
|
||||
public static T Show<T>(string title, Icon icon, object? tag = null) where T : RadFlyoutBase
|
||||
{
|
||||
return Show<T>(null, title, icon, tag);
|
||||
}
|
||||
|
||||
public static T ShowDialog<T>(string title, Icon icon, object? tag = null) where T : FlyoutBase
|
||||
public static T ShowDialog<T>(string title, Icon icon, object? tag = null) where T : RadFlyoutBase
|
||||
{
|
||||
return ShowDialog<T>(null, title, icon, tag);
|
||||
}
|
||||
|
||||
public static T Show<T>(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : FlyoutBase
|
||||
public static T Show<T>(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : RadFlyoutBase
|
||||
{
|
||||
return Show(CreatePanelInstance<T>(tag), parent, title, icon);
|
||||
}
|
||||
|
||||
public static T ShowDialog<T>(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : FlyoutBase
|
||||
public static T ShowDialog<T>(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : RadFlyoutBase
|
||||
{
|
||||
return ShowDialog(CreatePanelInstance<T>(tag), parent, title, icon);
|
||||
}
|
||||
|
||||
public static T Show<T>(T dialogPanel, string title, Icon icon) where T : FlyoutBase
|
||||
public static T Show<T>(T dialogPanel, string title, Icon icon) where T : RadFlyoutBase
|
||||
{
|
||||
return Show(dialogPanel, null, title, icon);
|
||||
}
|
||||
|
||||
public static T ShowDialog<T>(T dialogPanel, string title, Icon icon) where T : FlyoutBase
|
||||
public static T ShowDialog<T>(T dialogPanel, string title, Icon icon) where T : RadFlyoutBase
|
||||
{
|
||||
return ShowDialog(dialogPanel, null, title, icon);
|
||||
}
|
||||
|
||||
public static T Show<T>(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : FlyoutBase
|
||||
public static T Show<T>(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : RadFlyoutBase
|
||||
{
|
||||
CreateForm(dialogPanel, parent, title, icon).Show();
|
||||
return dialogPanel;
|
||||
}
|
||||
|
||||
public static T ShowDialog<T>(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : FlyoutBase
|
||||
public static T ShowDialog<T>(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : RadFlyoutBase
|
||||
{
|
||||
CreateForm(dialogPanel, parent, title, icon).ShowDialog();
|
||||
return dialogPanel;
|
||||
}
|
||||
|
||||
private static T CreatePanelInstance<T>(object? tag) where T : FlyoutBase
|
||||
private static T CreatePanelInstance<T>(object? tag) where T : RadFlyoutBase
|
||||
{
|
||||
T dialogPanel = Activator.CreateInstance<T>();
|
||||
dialogPanel.Tag = tag;
|
||||
return dialogPanel;
|
||||
}
|
||||
|
||||
private static DialogBase CreateForm<T>(T dialogPanel, IWin32Window? parent, string title, Icon icon) where T : FlyoutBase
|
||||
private static RadDialogBase CreateForm<T>(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,
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
partial class FlyoutBase
|
||||
partial class RadFlyoutBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Erforderliche Designervariable.
|
||||
@@ -28,7 +28,7 @@
|
||||
/// </summary>
|
||||
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();
|
||||
@@ -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)
|
||||
{
|
||||
@@ -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();
|
||||
Reference in New Issue
Block a user