add Pilz.UI.Telerik & Pilz.UI.Telerik.SymbolFactory
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<PackageId>Pilz.UI.Telerik</PackageId>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>Pilz.UI.Telerik</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
||||
<PackageReference Include="UI.for.WinForms.Common" Version="2023.1.117" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
16
Pilz.UI.Telerik.SymbolFactory/SvgImageSize.cs
Normal file
16
Pilz.UI.Telerik.SymbolFactory/SvgImageSize.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.UI.Telerik
|
||||
{
|
||||
public enum SvgImageSize
|
||||
{
|
||||
Default,
|
||||
Small,
|
||||
Medium,
|
||||
Large
|
||||
}
|
||||
}
|
||||
87
Pilz.UI.Telerik.SymbolFactory/SymbolFactory.cs
Normal file
87
Pilz.UI.Telerik.SymbolFactory/SymbolFactory.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System.Drawing;
|
||||
using System.Reflection;
|
||||
using Telerik.WinControls;
|
||||
using Telerik.WinControls.Svg;
|
||||
|
||||
namespace Pilz.UI.Telerik
|
||||
{
|
||||
public abstract class SymbolFactory<TSvgSymbols> where TSvgSymbols : Enum
|
||||
{
|
||||
public abstract string GetSvgImageRessourcePath(TSvgSymbols svgImage);
|
||||
public abstract Assembly GetSvgImageResourceAssembly();
|
||||
|
||||
protected virtual Size ResolveCommonSize(SvgImageSize size)
|
||||
{
|
||||
return size switch
|
||||
{
|
||||
SvgImageSize.Small => new Size(16, 16),
|
||||
SvgImageSize.Medium => new Size(20, 20),
|
||||
SvgImageSize.Large => new Size(32, 32),
|
||||
_ => Size.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
public virtual Stream? GetSvgImageRessourceStream(TSvgSymbols svgImage)
|
||||
{
|
||||
var asm = GetSvgImageResourceAssembly();
|
||||
var path = GetSvgImageRessourcePath(svgImage);
|
||||
return asm.GetManifestResourceStream(path);
|
||||
}
|
||||
|
||||
public virtual RadSvgImage GetSvgImage(TSvgSymbols svgImage, SvgImageSize size)
|
||||
{
|
||||
return GetSvgImage(svgImage, ResolveCommonSize(size));
|
||||
}
|
||||
|
||||
public virtual RadSvgImage GetSvgImage(TSvgSymbols svgImage, Size size)
|
||||
{
|
||||
using var stream = GetSvgImageRessourceStream(svgImage);
|
||||
var img = RadSvgImage.FromStream(stream);
|
||||
|
||||
if (size.IsEmpty)
|
||||
img.Size = size;
|
||||
|
||||
return img;
|
||||
}
|
||||
|
||||
public virtual RadSvgImage GetSvgImageColored(TSvgSymbols svgImage, SvgImageSize size, Color color)
|
||||
{
|
||||
return GetSvgImageColored(svgImage, ResolveCommonSize(size), color);
|
||||
}
|
||||
|
||||
public virtual RadSvgImage GetSvgImageColored(TSvgSymbols svgImage, Size size, Color color)
|
||||
{
|
||||
var img = GetSvgImage(svgImage, size);
|
||||
|
||||
img.Document.Fill = new SvgColourServer(color);
|
||||
img.ClearCache();
|
||||
|
||||
return img;
|
||||
}
|
||||
|
||||
public virtual Image GetImage(TSvgSymbols svgImage, SvgImageSize size)
|
||||
{
|
||||
return GetImage(svgImage, ResolveCommonSize(size));
|
||||
}
|
||||
|
||||
public virtual Image GetImage(TSvgSymbols svgImage, Size size)
|
||||
{
|
||||
return GetImageFromSvg(GetSvgImage(svgImage, size));
|
||||
}
|
||||
|
||||
public virtual Image GetImageColored(TSvgSymbols svgImage, SvgImageSize size, Color color)
|
||||
{
|
||||
return GetImageColored(svgImage, ResolveCommonSize(size), color);
|
||||
}
|
||||
|
||||
public virtual Image GetImageColored(TSvgSymbols svgImage, Size size, Color color)
|
||||
{
|
||||
return GetImageFromSvg(GetSvgImageColored(svgImage, size, color));
|
||||
}
|
||||
|
||||
public virtual Image GetImageFromSvg(RadSvgImage svg)
|
||||
{
|
||||
return svg.Document.Draw(svg.Width, svg.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Pilz.UI.Telerik/Dialogs/DialogBaseForm.Statics.cs
Normal file
44
Pilz.UI.Telerik/Dialogs/DialogBaseForm.Statics.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
partial class DialogBaseForm
|
||||
{
|
||||
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 ShowDialog<T>(string title, Icon icon, object? tag = null) where T : FlyoutDialogBase
|
||||
{
|
||||
return ShowDialog<T>(null, title, icon, tag);
|
||||
}
|
||||
|
||||
public static T ShowDialog<T>(IWin32Window? parent, string title, Icon icon, object? tag = null) where T : FlyoutDialogBase
|
||||
{
|
||||
var dialogPanel = Activator.CreateInstance<T>();
|
||||
dialogPanel.Dock = DockStyle.Fill;
|
||||
dialogPanel.Tag = tag;
|
||||
|
||||
var dialog = new DialogBaseForm
|
||||
{
|
||||
DialogPanel = dialogPanel,
|
||||
Text = title,
|
||||
Icon = icon,
|
||||
StartPosition = parent == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent,
|
||||
ClientSize = dialogPanel.Size
|
||||
};
|
||||
dialog.Controls.Add(dialogPanel);
|
||||
dialog.ShowDialog(parent);
|
||||
|
||||
return dialogPanel;
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Pilz.UI.Telerik/Dialogs/DialogBaseForm.cs
Normal file
34
Pilz.UI.Telerik/Dialogs/DialogBaseForm.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
public partial class DialogBaseForm : RadForm
|
||||
{
|
||||
public FlyoutDialogBase? DialogPanel { get; private set; }
|
||||
|
||||
private DialogBaseForm()
|
||||
{
|
||||
Load += DialogBaseForm_Load;
|
||||
FormClosed += DialogBaseForm_FormClosed;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Pilz.UI.Telerik/Dialogs/DialogClosedEventArgs.cs
Normal file
20
Pilz.UI.Telerik/Dialogs/DialogClosedEventArgs.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
public class DialogClosedEventArgs : EventArgs
|
||||
{
|
||||
public DialogBaseForm Parent { get; private set; }
|
||||
public FlyoutDialogBase? Content => Parent?.DialogPanel;
|
||||
|
||||
public DialogClosedEventArgs(DialogBaseForm dialog)
|
||||
{
|
||||
Parent = dialog;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Pilz.UI.Telerik/Dialogs/DialogLoadingEventArgs.cs
Normal file
21
Pilz.UI.Telerik/Dialogs/DialogLoadingEventArgs.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.Design;
|
||||
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
public class DialogLoadingEventArgs : EventArgs
|
||||
{
|
||||
public DialogBaseForm Parent { get; private set; }
|
||||
public FlyoutDialogBase? Content => Parent?.DialogPanel;
|
||||
|
||||
public DialogLoadingEventArgs(DialogBaseForm dialog)
|
||||
{
|
||||
Parent = dialog;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Pilz.UI.Telerik/Dialogs/FlyoutClosedEventArgs.cs
Normal file
18
Pilz.UI.Telerik/Dialogs/FlyoutClosedEventArgs.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
public class FlyoutClosedEventArgs : global::Telerik.WinControls.UI.SplashScreen.FlyoutClosedEventArgs
|
||||
{
|
||||
public new FlyoutDialogBase? Content => base.Content as FlyoutDialogBase;
|
||||
|
||||
public FlyoutClosedEventArgs(FlyoutDialogBase content) : base(content)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Pilz.UI.Telerik/Dialogs/FlyoutCreatedEventArgs.cs
Normal file
19
Pilz.UI.Telerik/Dialogs/FlyoutCreatedEventArgs.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls.UI.SplashScreen;
|
||||
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
public class FlyoutCreatedEventArgs : ContentCreatedEventArgs
|
||||
{
|
||||
public new FlyoutDialogBase? Content => base.Content as FlyoutDialogBase;
|
||||
|
||||
public FlyoutCreatedEventArgs(FlyoutDialogBase content) : base(content)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
77
Pilz.UI.Telerik/Dialogs/FlyoutDialogBase.Designer.cs
generated
Normal file
77
Pilz.UI.Telerik/Dialogs/FlyoutDialogBase.Designer.cs
generated
Normal file
@@ -0,0 +1,77 @@
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
partial class FlyoutDialogBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Erforderliche Designervariable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verwendete Ressourcen bereinigen.
|
||||
/// </summary>
|
||||
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Vom Komponenten-Designer generierter Code
|
||||
|
||||
/// <summary>
|
||||
/// Erforderliche Methode für die Designerunterstützung.
|
||||
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FlyoutDialogBase));
|
||||
radButton_Cancel = new global::Telerik.WinControls.UI.RadButton();
|
||||
radButton_Confirm = new global::Telerik.WinControls.UI.RadButton();
|
||||
panel_ActionButtons = new System.Windows.Forms.Panel();
|
||||
((System.ComponentModel.ISupportInitialize)radButton_Cancel).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)radButton_Confirm).BeginInit();
|
||||
panel_ActionButtons.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// radButton_Cancel
|
||||
//
|
||||
resources.ApplyResources(radButton_Cancel, "radButton_Cancel");
|
||||
radButton_Cancel.Name = "radButton_Cancel";
|
||||
radButton_Cancel.Click += RadButton_Cancel_Click;
|
||||
//
|
||||
// radButton_Confirm
|
||||
//
|
||||
resources.ApplyResources(radButton_Confirm, "radButton_Confirm");
|
||||
radButton_Confirm.Name = "radButton_Confirm";
|
||||
radButton_Confirm.Click += RadButton_Confirm_Click;
|
||||
//
|
||||
// panel_ActionButtons
|
||||
//
|
||||
panel_ActionButtons.Controls.Add(radButton_Cancel);
|
||||
panel_ActionButtons.Controls.Add(radButton_Confirm);
|
||||
resources.ApplyResources(panel_ActionButtons, "panel_ActionButtons");
|
||||
panel_ActionButtons.Name = "panel_ActionButtons";
|
||||
//
|
||||
// FlyoutDialogBase
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
Controls.Add(panel_ActionButtons);
|
||||
Name = "FlyoutDialogBase";
|
||||
((System.ComponentModel.ISupportInitialize)radButton_Cancel).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)radButton_Confirm).EndInit();
|
||||
panel_ActionButtons.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private global::Telerik.WinControls.UI.RadButton radButton_Cancel;
|
||||
private global::Telerik.WinControls.UI.RadButton radButton_Confirm;
|
||||
private System.Windows.Forms.Panel panel_ActionButtons;
|
||||
}
|
||||
}
|
||||
101
Pilz.UI.Telerik/Dialogs/FlyoutDialogBase.Statics.cs
Normal file
101
Pilz.UI.Telerik/Dialogs/FlyoutDialogBase.Statics.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Telerik.WinControls.UI.SplashScreen;
|
||||
using Telerik.WinControls.UI;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
partial class FlyoutDialogBase
|
||||
{
|
||||
public delegate void FlyoutCreatedEventHandler(FlyoutCreatedEventArgs e);
|
||||
public delegate void FlyoutClosedEventHandler(FlyoutClosedEventArgs e);
|
||||
|
||||
public static event FlyoutCreatedEventHandler FlyoutCreated
|
||||
{
|
||||
add => flyoutCreatedHandlers.Add(value);
|
||||
remove => flyoutCreatedHandlers.Remove(value);
|
||||
}
|
||||
|
||||
public static event FlyoutClosedEventHandler FlyoutClosed
|
||||
{
|
||||
add => flyoutCloseHandlers.Add(value);
|
||||
remove => flyoutCloseHandlers.Remove(value);
|
||||
}
|
||||
|
||||
private static readonly List<FlyoutCreatedEventHandler> flyoutCreatedHandlers = new();
|
||||
private static readonly List<FlyoutClosedEventHandler> flyoutCloseHandlers = new();
|
||||
|
||||
private static object? tagToAssign = null;
|
||||
public static Control? ParentContext { get; private set; } = null;
|
||||
|
||||
static FlyoutDialogBase()
|
||||
{
|
||||
RadFlyoutManager.ContentCreated += RadFlyoutManager_ContentCreated;
|
||||
RadFlyoutManager.FlyoutClosed += RadFlyoutManager_FlyoutClosed;
|
||||
}
|
||||
|
||||
private static void RadFlyoutManager_ContentCreated(ContentCreatedEventArgs e)
|
||||
{
|
||||
if (e.Content is FlyoutDialogBase dialogBase)
|
||||
{
|
||||
if (tagToAssign != null)
|
||||
dialogBase.Tag = tagToAssign;
|
||||
|
||||
var eventArgs = new FlyoutCreatedEventArgs((FlyoutDialogBase)e.Content);
|
||||
|
||||
if (dialogBase is ILoadContent iLoadContent)
|
||||
iLoadContent.LoadContent();
|
||||
|
||||
foreach (var args in flyoutCreatedHandlers)
|
||||
{
|
||||
if (ParentContext != null)
|
||||
ParentContext?.Invoke(args, eventArgs);
|
||||
else
|
||||
args.Invoke(eventArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void RadFlyoutManager_FlyoutClosed(global::Telerik.WinControls.UI.SplashScreen.FlyoutClosedEventArgs e)
|
||||
{
|
||||
if (e.Content is FlyoutDialogBase dialogBase)
|
||||
{
|
||||
var eventArgs = new FlyoutClosedEventArgs((FlyoutDialogBase)e.Content);
|
||||
|
||||
foreach (var args in flyoutCloseHandlers)
|
||||
{
|
||||
if (ParentContext != null)
|
||||
ParentContext?.Invoke(args, eventArgs);
|
||||
else
|
||||
args.Invoke(eventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
ParentContext = null;
|
||||
}
|
||||
|
||||
public static void Show<T>(Control controlToAssociate, object? tag = null)
|
||||
{
|
||||
Show(controlToAssociate, typeof(T), tag);
|
||||
}
|
||||
|
||||
public static void Show(Control controlToAssociate, Type flyoutContentType, object? tag = null)
|
||||
{
|
||||
tagToAssign = tag;
|
||||
ParentContext = controlToAssociate;
|
||||
RadFlyoutManager.Show(controlToAssociate, flyoutContentType);
|
||||
}
|
||||
|
||||
protected static void CloseFlyout()
|
||||
{
|
||||
if (ParentContext == null)
|
||||
throw new NullReferenceException(nameof(ParentContext));
|
||||
|
||||
ParentContext.BeginInvoke(RadFlyoutManager.Close);
|
||||
}
|
||||
}
|
||||
}
|
||||
86
Pilz.UI.Telerik/Dialogs/FlyoutDialogBase.cs
Normal file
86
Pilz.UI.Telerik/Dialogs/FlyoutDialogBase.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using Pilz.UI.Telerik;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls;
|
||||
using Telerik.WinControls.UI;
|
||||
using Telerik.WinControls.UI.SplashScreen;
|
||||
using static Telerik.WinControls.UI.PopupEditorNotificationData;
|
||||
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
public partial class FlyoutDialogBase : UserControl
|
||||
{
|
||||
public static RadSvgImage? CancelSvg { get; set; } = null;
|
||||
public static RadSvgImage? ConfirmSvg { get; set; } = null;
|
||||
|
||||
public DialogResult Result { get; protected set; }
|
||||
|
||||
protected bool ActionPanelVisible
|
||||
{
|
||||
get => panel_ActionButtons.Visible;
|
||||
set => panel_ActionButtons.Visible = value;
|
||||
}
|
||||
|
||||
protected bool CancelButtonEnable
|
||||
{
|
||||
get => radButton_Cancel.Enabled;
|
||||
set => radButton_Cancel.Enabled = value;
|
||||
}
|
||||
|
||||
protected bool ConfirmButtonEnable
|
||||
{
|
||||
get => radButton_Confirm.Enabled;
|
||||
set => radButton_Confirm.Enabled = value;
|
||||
}
|
||||
|
||||
protected FlyoutDialogBase()
|
||||
{
|
||||
InitializeComponent();
|
||||
ParentChanged += FlyoutDialogBase_ParentChanged;
|
||||
|
||||
// SVG Symbols
|
||||
radButton_Cancel.SvgImage = CancelSvg;
|
||||
radButton_Confirm.SvgImage = ConfirmSvg;
|
||||
}
|
||||
|
||||
private void FlyoutDialogBase_ParentChanged(object? sender, EventArgs e)
|
||||
{
|
||||
var frm = FindForm();
|
||||
if (frm != null)
|
||||
frm.AcceptButton = radButton_Confirm;
|
||||
}
|
||||
|
||||
protected void Close(DialogResult result)
|
||||
{
|
||||
Result = result;
|
||||
|
||||
if (FindForm() is DialogBaseForm dialogForm)
|
||||
dialogForm.Close();
|
||||
else
|
||||
CloseFlyout();
|
||||
}
|
||||
|
||||
private void RadButton_Confirm_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ValidateOK())
|
||||
Close(DialogResult.OK);
|
||||
}
|
||||
|
||||
private void RadButton_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close(DialogResult.Cancel);
|
||||
}
|
||||
|
||||
protected virtual bool ValidateOK()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
234
Pilz.UI.Telerik/Dialogs/FlyoutDialogBase.resx
Normal file
234
Pilz.UI.Telerik/Dialogs/FlyoutDialogBase.resx
Normal file
@@ -0,0 +1,234 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="radButton_Cancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="radButton_Cancel.ImageAlignment" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name="radButton_Cancel.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>187, 3</value>
|
||||
</data>
|
||||
<data name="radButton_Cancel.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>110, 24</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="radButton_Cancel.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="radButton_Cancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="radButton_Cancel.TextAlignment" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleLeft</value>
|
||||
</data>
|
||||
<data name="radButton_Cancel.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
|
||||
<value>ImageBeforeText</value>
|
||||
</data>
|
||||
<data name=">>radButton_Cancel.Name" xml:space="preserve">
|
||||
<value>radButton_Cancel</value>
|
||||
</data>
|
||||
<data name=">>radButton_Cancel.Type" xml:space="preserve">
|
||||
<value>Telerik.WinControls.UI.RadButton, Telerik.WinControls.UI, Culture=neutral, PublicKeyToken=5bb2a467cbec794e</value>
|
||||
</data>
|
||||
<data name=">>radButton_Cancel.Parent" xml:space="preserve">
|
||||
<value>panel_ActionButtons</value>
|
||||
</data>
|
||||
<data name=">>radButton_Cancel.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="radButton_Confirm.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="radButton_Confirm.ImageAlignment" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleRight</value>
|
||||
</data>
|
||||
<data name="radButton_Confirm.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>71, 3</value>
|
||||
</data>
|
||||
<data name="radButton_Confirm.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>110, 24</value>
|
||||
</data>
|
||||
<data name="radButton_Confirm.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="radButton_Confirm.Text" xml:space="preserve">
|
||||
<value>Okay</value>
|
||||
</data>
|
||||
<data name="radButton_Confirm.TextAlignment" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>MiddleLeft</value>
|
||||
</data>
|
||||
<data name="radButton_Confirm.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
|
||||
<value>ImageBeforeText</value>
|
||||
</data>
|
||||
<data name=">>radButton_Confirm.Name" xml:space="preserve">
|
||||
<value>radButton_Confirm</value>
|
||||
</data>
|
||||
<data name=">>radButton_Confirm.Type" xml:space="preserve">
|
||||
<value>Telerik.WinControls.UI.RadButton, Telerik.WinControls.UI, Culture=neutral, PublicKeyToken=5bb2a467cbec794e</value>
|
||||
</data>
|
||||
<data name=">>radButton_Confirm.Parent" xml:space="preserve">
|
||||
<value>panel_ActionButtons</value>
|
||||
</data>
|
||||
<data name=">>radButton_Confirm.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="panel_ActionButtons.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Bottom</value>
|
||||
</data>
|
||||
<data name="panel_ActionButtons.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 120</value>
|
||||
</data>
|
||||
<data name="panel_ActionButtons.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>300, 30</value>
|
||||
</data>
|
||||
<data name="panel_ActionButtons.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name=">>panel_ActionButtons.Name" xml:space="preserve">
|
||||
<value>panel_ActionButtons</value>
|
||||
</data>
|
||||
<data name=">>panel_ActionButtons.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Panel, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>panel_ActionButtons.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>panel_ActionButtons.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>7, 15</value>
|
||||
</data>
|
||||
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>300, 150</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>FlyoutDialogBase</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
13
Pilz.UI.Telerik/Dialogs/ILoadContent.cs
Normal file
13
Pilz.UI.Telerik/Dialogs/ILoadContent.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.UI.Telerik.Dialogs
|
||||
{
|
||||
public interface ILoadContent
|
||||
{
|
||||
void LoadContent();
|
||||
}
|
||||
}
|
||||
14
Pilz.UI.Telerik/Pilz.UI.Telerik.csproj
Normal file
14
Pilz.UI.Telerik/Pilz.UI.Telerik.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="UI.for.WinForms.AllControls.Net60" Version="2023.1.117" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
24
Pilz.sln
24
Pilz.sln
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.329
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.7.34018.315
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Pilz", "Pilz\Pilz.vbproj", "{277D2B83-7613-4C49-9CAB-E080195A6E0C}"
|
||||
EndProject
|
||||
@@ -31,6 +31,10 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Pilz.Networking", "Pilz.Net
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pilz.Cryptography", "Pilz.Cryptography\Pilz.Cryptography.csproj", "{3F5988E6-439E-4A9D-B2C6-47EFFB161AC6}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pilz.UI.Telerik.SymbolFactory", "Pilz.UI.Telerik.SymbolFactory\Pilz.UI.Telerik.SymbolFactory.csproj", "{2B3B8161-29FF-4526-9082-4410AB5144A5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pilz.UI.Telerik", "Pilz.UI.Telerik\Pilz.UI.Telerik.csproj", "{DF674119-CC28-40AA-968F-1E23D184A491}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -151,6 +155,22 @@ Global
|
||||
{3F5988E6-439E-4A9D-B2C6-47EFFB161AC6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3F5988E6-439E-4A9D-B2C6-47EFFB161AC6}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{3F5988E6-439E-4A9D-B2C6-47EFFB161AC6}.Release|x86.Build.0 = Release|Any CPU
|
||||
{2B3B8161-29FF-4526-9082-4410AB5144A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2B3B8161-29FF-4526-9082-4410AB5144A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2B3B8161-29FF-4526-9082-4410AB5144A5}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{2B3B8161-29FF-4526-9082-4410AB5144A5}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{2B3B8161-29FF-4526-9082-4410AB5144A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2B3B8161-29FF-4526-9082-4410AB5144A5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2B3B8161-29FF-4526-9082-4410AB5144A5}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{2B3B8161-29FF-4526-9082-4410AB5144A5}.Release|x86.Build.0 = Release|Any CPU
|
||||
{DF674119-CC28-40AA-968F-1E23D184A491}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DF674119-CC28-40AA-968F-1E23D184A491}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF674119-CC28-40AA-968F-1E23D184A491}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{DF674119-CC28-40AA-968F-1E23D184A491}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{DF674119-CC28-40AA-968F-1E23D184A491}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF674119-CC28-40AA-968F-1E23D184A491}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DF674119-CC28-40AA-968F-1E23D184A491}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{DF674119-CC28-40AA-968F-1E23D184A491}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user