update client gui
This commit is contained in:
@@ -22,14 +22,14 @@ namespace Pilz.Updating.Client.GUI {
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class MyIcons {
|
||||
internal class LangRes {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal MyIcons() {
|
||||
internal LangRes() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -39,7 +39,7 @@ namespace Pilz.Updating.Client.GUI {
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Pilz.Updating.Client.GUI.MyIcons", typeof(MyIcons).Assembly);
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Pilz.Updating.Client.GUI.LangRes", typeof(LangRes).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
@@ -61,22 +61,29 @@ namespace Pilz.Updating.Client.GUI {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die <html><a href="{0}">Open link to notes in browser!</a></html> ähnelt.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_delete_16px {
|
||||
internal static string NotesLinkToExternal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8_delete_16px", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
return ResourceManager.GetString("NotesLinkToExternal", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die No release notes not available or not provided. ähnelt.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_software_installer_16px {
|
||||
internal static string NotesNotAvailable {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8_software_installer_16px", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
return ResourceManager.GetString("NotesNotAvailable", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Updates available ähnelt.
|
||||
/// </summary>
|
||||
internal static string Title_UpdatesAvailable {
|
||||
get {
|
||||
return ResourceManager.GetString("Title_UpdatesAvailable", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,11 +117,13 @@
|
||||
<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, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="icons8_delete_16px" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\icons8_delete_16px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="NotesLinkToExternal" xml:space="preserve">
|
||||
<value><html><a href="{0}">Open link to notes in browser!</a></html></value>
|
||||
</data>
|
||||
<data name="icons8_software_installer_16px" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\icons8_software_installer_16px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="NotesNotAvailable" xml:space="preserve">
|
||||
<value>No release notes not available or not provided.</value>
|
||||
</data>
|
||||
<data name="Title_UpdatesAvailable" xml:space="preserve">
|
||||
<value>Updates available</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -11,10 +11,10 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="MyIcons.Designer.cs">
|
||||
<Compile Update="LangRes.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>MyIcons.resx</DependentUpon>
|
||||
<DependentUpon>LangRes.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="SimpleActionDialog.Designer.cs">
|
||||
<DependentUpon>SimpleActionDialog.cs</DependentUpon>
|
||||
@@ -22,18 +22,11 @@
|
||||
<Compile Update="SimpleActionDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UpdatesAvailableDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UpdatesAvailableDialog.cs" />
|
||||
<Compile Update="UpdatesAvailableDialog.Designer.cs">
|
||||
<DependentUpon>UpdatesAvailableDialog.cs</DependentUpon>
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="UpdatingClientGuiLangRes.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
@@ -42,10 +35,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="MyIcons.resx">
|
||||
<EmbeddedResource Update="LangRes.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>MyIcons.Designer.cs</LastGenOutput>
|
||||
<CustomToolNamespace>Pilz.Updating.Client.GUI</CustomToolNamespace>
|
||||
<LastGenOutput>LangRes.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="SimpleActionDialog.de.resx">
|
||||
<DependentUpon>SimpleActionDialog.cs</DependentUpon>
|
||||
@@ -59,12 +51,6 @@
|
||||
<EmbeddedResource Update="UpdatesAvailableDialog.resx">
|
||||
<DependentUpon>UpdatesAvailableDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<CustomToolNamespace>SM64_ROM_Manager.Updating.Client.GUI.My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="UpdatingClientGuiLangRes.de.resx">
|
||||
<Generator></Generator>
|
||||
<CustomToolNamespace>Pilz.Updating.Client.GUI</CustomToolNamespace>
|
||||
@@ -86,6 +72,8 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" />
|
||||
<PackageReference Include="Pilz.IO" Version="2.0.0" />
|
||||
<PackageReference Include="Pilz.UI.Telerik" Version="2.5.2" />
|
||||
<PackageReference Include="Pilz.UI.Telerik.SymbolFactory" Version="2.0.3" />
|
||||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageReference Include="Markdig" Version="0.37.0" />
|
||||
|
||||
63
Pilz.Updating.Client.GUI/Resources.Designer.cs
generated
63
Pilz.Updating.Client.GUI/Resources.Designer.cs
generated
@@ -1,63 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SM64_ROM_Manager.Updating.Client.GUI.My.Resources {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Pilz.Updating.Client.GUI.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 562 B |
Binary file not shown.
|
Before Width: | Height: | Size: 430 B |
@@ -1,54 +1,19 @@
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using Pilz.UI;
|
||||
using Pilz.UI.Telerik.Dialogs;
|
||||
using Pilz.Updating.GUIBase;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Telerik.WinControls;
|
||||
|
||||
namespace Pilz.Updating.Client.GUI;
|
||||
|
||||
public class UpdateClientGUI
|
||||
{
|
||||
|
||||
// F i e l d s
|
||||
|
||||
private Form parentForm;
|
||||
private UpdateClient _UpdateClient;
|
||||
|
||||
private UpdateClient UpdateClient
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
get
|
||||
{
|
||||
return _UpdateClient;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
set
|
||||
{
|
||||
if (_UpdateClient != null)
|
||||
{
|
||||
|
||||
// U p d a t e C l i e n t - E v e n t s
|
||||
|
||||
_UpdateClient.UpdateStatusChanged -= MyUpdateClient_UpdateStatusChanged;
|
||||
_UpdateClient.DownloadingUpdate -= MyUpdateClient_DownloadingUpdate;
|
||||
_UpdateClient.InstallingUpdate -= MyUpdateClient_InstallingUpdate;
|
||||
_UpdateClient.UpdateInstallerStarted -= MyUpdateClient_FinishWork;
|
||||
_UpdateClient.NoUpdatesFound -= MyUpdateClient_NoUpdatesFound;
|
||||
}
|
||||
|
||||
_UpdateClient = value;
|
||||
if (_UpdateClient != null)
|
||||
{
|
||||
_UpdateClient.UpdateStatusChanged += MyUpdateClient_UpdateStatusChanged;
|
||||
_UpdateClient.DownloadingUpdate += MyUpdateClient_DownloadingUpdate;
|
||||
_UpdateClient.InstallingUpdate += MyUpdateClient_InstallingUpdate;
|
||||
_UpdateClient.UpdateInstallerStarted += MyUpdateClient_FinishWork;
|
||||
_UpdateClient.NoUpdatesFound += MyUpdateClient_NoUpdatesFound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private SimpleActionDialog curProgressDialog = null;
|
||||
private SimpleActionDialog curProgressDialog;
|
||||
private readonly UpdateClient updateClient;
|
||||
|
||||
// P r o p e r t i e s
|
||||
|
||||
@@ -60,7 +25,21 @@ public class UpdateClientGUI
|
||||
|
||||
public UpdateClientGUI(UpdateClient updateClient)
|
||||
{
|
||||
UpdateClient = updateClient;
|
||||
this.updateClient = updateClient;
|
||||
updateClient.UpdateStatusChanged += MyUpdateClient_UpdateStatusChanged;
|
||||
updateClient.DownloadingUpdate += MyUpdateClient_DownloadingUpdate;
|
||||
updateClient.InstallingUpdate += MyUpdateClient_InstallingUpdate;
|
||||
updateClient.UpdateInstallerStarted += MyUpdateClient_FinishWork;
|
||||
updateClient.NoUpdatesFound += MyUpdateClient_NoUpdatesFound;
|
||||
}
|
||||
|
||||
~UpdateClientGUI()
|
||||
{
|
||||
updateClient.UpdateStatusChanged -= MyUpdateClient_UpdateStatusChanged;
|
||||
updateClient.DownloadingUpdate -= MyUpdateClient_DownloadingUpdate;
|
||||
updateClient.InstallingUpdate -= MyUpdateClient_InstallingUpdate;
|
||||
updateClient.UpdateInstallerStarted -= MyUpdateClient_FinishWork;
|
||||
updateClient.NoUpdatesFound -= MyUpdateClient_NoUpdatesFound;
|
||||
}
|
||||
|
||||
// F e a t u r e s
|
||||
@@ -68,13 +47,12 @@ public class UpdateClientGUI
|
||||
public async Task UpdateInteractive(Form parentForm)
|
||||
{
|
||||
this.parentForm = parentForm;
|
||||
await UpdateClient.UpdateInteractive();
|
||||
await updateClient.UpdateInteractive();
|
||||
}
|
||||
|
||||
private void EndUpdating()
|
||||
{
|
||||
curProgressDialog?.Invoke(new Action(() => curProgressDialog.Close()));
|
||||
UpdateClient = null;
|
||||
}
|
||||
|
||||
private void MyUpdateClient_UpdateStatusChanged(UpdateStatus newStatus)
|
||||
@@ -104,8 +82,9 @@ public class UpdateClientGUI
|
||||
var dres = default(DialogResult);
|
||||
parentForm.Invoke(new Action(() =>
|
||||
{
|
||||
var dialog = new UpdatesAvailableDialog(MyAppIcon, UpdateClient.CurrentVersion.Version.ToString(), UpdateClient.CurrentVersion.Channel.ToString(), Conversions.ToString(UpdateClient.CurrentVersion.Build), pkg.Version.Version.ToString(), pkg.Version.Channel.ToString(), Conversions.ToString(pkg.Version.Build), pkg.Notes, UpdateClient.InstallAsAdmin);
|
||||
dres = dialog.ShowDialog(parentForm);
|
||||
var dialog = new UpdatesAvailableDialog(MyAppIcon, updateClient.CurrentVersion.Version.ToString(), updateClient.CurrentVersion.Channel.ToString(), Conversions.ToString(updateClient.CurrentVersion.Build), pkg.Version.Version.ToString(), pkg.Version.Channel.ToString(), Conversions.ToString(pkg.Version.Build), pkg.Notes, updateClient.InstallAsAdmin);
|
||||
var symbol = GlobalSymbolFactory.Instance.GetImage(GlobalSymbols.software_installer, UI.Telerik.SvgImageSize.Small).ToIcon();
|
||||
dres = RadDialogBase.ShowDialog(dialog, parentForm, LangRes.Title_UpdatesAvailable, symbol).Result;
|
||||
}));
|
||||
if (dres != DialogResult.OK)
|
||||
{
|
||||
@@ -132,9 +111,8 @@ public class UpdateClientGUI
|
||||
private void MyUpdateClient_NoUpdatesFound()
|
||||
{
|
||||
EndUpdating();
|
||||
|
||||
if (!UseHiddenSearch)
|
||||
{
|
||||
RadMessageBox.Show(UpdatingClientGuiLangRes.MsgBox_NoUpdatesFound, UpdatingClientGuiLangRes.MsgBox_NoUpdatesFound_Titel, MessageBoxButtons.OK, RadMessageIcon.Info);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using System.Diagnostics;
|
||||
namespace Pilz.Updating.Client.GUI
|
||||
{
|
||||
[DesignerGenerated()]
|
||||
internal partial class UpdatesAvailableDialog : Telerik.WinControls.UI.RadForm
|
||||
internal partial class UpdatesAvailableDialog
|
||||
{
|
||||
|
||||
// Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||
@@ -34,7 +34,6 @@ namespace Pilz.Updating.Client.GUI
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdatesAvailableDialog));
|
||||
panel1 = new Panel();
|
||||
radButton_Cancel = new Telerik.WinControls.UI.RadButton();
|
||||
radButton_Install = new Telerik.WinControls.UI.RadButton();
|
||||
panel_ChangelogPanel = new Panel();
|
||||
@@ -54,7 +53,7 @@ namespace Pilz.Updating.Client.GUI
|
||||
radLabel1 = new Telerik.WinControls.UI.RadLabel();
|
||||
radPictureBox1 = new Telerik.WinControls.UI.RadPictureBox();
|
||||
layoutControlLabelItem1 = new Telerik.WinControls.UI.LayoutControlLabelItem();
|
||||
panel1.SuspendLayout();
|
||||
tableLayoutPanel1 = new TableLayoutPanel();
|
||||
((System.ComponentModel.ISupportInitialize)radButton_Cancel).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)radButton_Install).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)radLabel10).BeginInit();
|
||||
@@ -72,55 +71,33 @@ namespace Pilz.Updating.Client.GUI
|
||||
((System.ComponentModel.ISupportInitialize)radLabel2).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)radLabel1).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)radPictureBox1).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)this).BeginInit();
|
||||
tableLayoutPanel1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
panel1.BackColor = Color.Transparent;
|
||||
panel1.Controls.Add(radButton_Cancel);
|
||||
panel1.Controls.Add(radButton_Install);
|
||||
panel1.Controls.Add(panel_ChangelogPanel);
|
||||
panel1.Controls.Add(radLabel10);
|
||||
panel1.Controls.Add(radLabel_CurrentVersionBuild);
|
||||
panel1.Controls.Add(radLabel7);
|
||||
panel1.Controls.Add(radLabel_AvailableVersionBuild);
|
||||
panel1.Controls.Add(radLabel9);
|
||||
panel1.Controls.Add(radLabel_CurrentVersionChannel);
|
||||
panel1.Controls.Add(radLabel3);
|
||||
panel1.Controls.Add(radLabel_AvailableVersionChannel);
|
||||
panel1.Controls.Add(radLabel4);
|
||||
panel1.Controls.Add(radLabel_CurrentVersion);
|
||||
panel1.Controls.Add(radLabel5);
|
||||
panel1.Controls.Add(radLabel_AvailableVersion);
|
||||
panel1.Controls.Add(radLabel2);
|
||||
panel1.Controls.Add(radLabel1);
|
||||
panel1.Controls.Add(radPictureBox1);
|
||||
resources.ApplyResources(panel1, "panel1");
|
||||
panel1.Name = "panel1";
|
||||
//
|
||||
// radButton_Cancel
|
||||
//
|
||||
resources.ApplyResources(radButton_Cancel, "radButton_Cancel");
|
||||
radButton_Cancel.DialogResult = DialogResult.Cancel;
|
||||
radButton_Cancel.Image = MyIcons.icons8_delete_16px;
|
||||
tableLayoutPanel1.SetColumnSpan(radButton_Cancel, 2);
|
||||
radButton_Cancel.Name = "radButton_Cancel";
|
||||
radButton_Cancel.Click += RadButton_Cancel_Click;
|
||||
//
|
||||
// radButton_Install
|
||||
//
|
||||
resources.ApplyResources(radButton_Install, "radButton_Install");
|
||||
radButton_Install.DialogResult = DialogResult.OK;
|
||||
radButton_Install.Image = MyIcons.icons8_software_installer_16px;
|
||||
tableLayoutPanel1.SetColumnSpan(radButton_Install, 2);
|
||||
radButton_Install.Name = "radButton_Install";
|
||||
radButton_Install.Click += RadButton_Install_Click;
|
||||
//
|
||||
// panel_ChangelogPanel
|
||||
//
|
||||
resources.ApplyResources(panel_ChangelogPanel, "panel_ChangelogPanel");
|
||||
tableLayoutPanel1.SetColumnSpan(panel_ChangelogPanel, 7);
|
||||
panel_ChangelogPanel.Name = "panel_ChangelogPanel";
|
||||
//
|
||||
// radLabel10
|
||||
//
|
||||
resources.ApplyResources(radLabel10, "radLabel10");
|
||||
tableLayoutPanel1.SetColumnSpan(radLabel10, 2);
|
||||
radLabel10.Name = "radLabel10";
|
||||
//
|
||||
// radLabel_CurrentVersionBuild
|
||||
@@ -171,6 +148,7 @@ namespace Pilz.Updating.Client.GUI
|
||||
// radLabel5
|
||||
//
|
||||
resources.ApplyResources(radLabel5, "radLabel5");
|
||||
tableLayoutPanel1.SetColumnSpan(radLabel5, 2);
|
||||
radLabel5.Name = "radLabel5";
|
||||
//
|
||||
// radLabel_AvailableVersion
|
||||
@@ -181,11 +159,13 @@ namespace Pilz.Updating.Client.GUI
|
||||
// radLabel2
|
||||
//
|
||||
resources.ApplyResources(radLabel2, "radLabel2");
|
||||
tableLayoutPanel1.SetColumnSpan(radLabel2, 2);
|
||||
radLabel2.Name = "radLabel2";
|
||||
//
|
||||
// radLabel1
|
||||
//
|
||||
resources.ApplyResources(radLabel1, "radLabel1");
|
||||
tableLayoutPanel1.SetColumnSpan(radLabel1, 6);
|
||||
radLabel1.Name = "radLabel1";
|
||||
//
|
||||
// radPictureBox1
|
||||
@@ -203,19 +183,36 @@ namespace Pilz.Updating.Client.GUI
|
||||
layoutControlLabelItem1.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault;
|
||||
layoutControlLabelItem1.UseCompatibleTextRendering = false;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
resources.ApplyResources(tableLayoutPanel1, "tableLayoutPanel1");
|
||||
tableLayoutPanel1.Controls.Add(radButton_Install, 3, 5);
|
||||
tableLayoutPanel1.Controls.Add(radButton_Cancel, 5, 5);
|
||||
tableLayoutPanel1.Controls.Add(radPictureBox1, 0, 0);
|
||||
tableLayoutPanel1.Controls.Add(radLabel1, 1, 0);
|
||||
tableLayoutPanel1.Controls.Add(panel_ChangelogPanel, 0, 4);
|
||||
tableLayoutPanel1.Controls.Add(radLabel5, 0, 1);
|
||||
tableLayoutPanel1.Controls.Add(radLabel10, 0, 3);
|
||||
tableLayoutPanel1.Controls.Add(radLabel_CurrentVersion, 2, 1);
|
||||
tableLayoutPanel1.Controls.Add(radLabel4, 3, 2);
|
||||
tableLayoutPanel1.Controls.Add(radLabel3, 3, 1);
|
||||
tableLayoutPanel1.Controls.Add(radLabel_CurrentVersionChannel, 4, 1);
|
||||
tableLayoutPanel1.Controls.Add(radLabel_AvailableVersionChannel, 4, 2);
|
||||
tableLayoutPanel1.Controls.Add(radLabel9, 5, 2);
|
||||
tableLayoutPanel1.Controls.Add(radLabel7, 5, 1);
|
||||
tableLayoutPanel1.Controls.Add(radLabel_CurrentVersionBuild, 6, 1);
|
||||
tableLayoutPanel1.Controls.Add(radLabel_AvailableVersionBuild, 6, 2);
|
||||
tableLayoutPanel1.Controls.Add(radLabel2, 0, 2);
|
||||
tableLayoutPanel1.Controls.Add(radLabel_AvailableVersion, 2, 2);
|
||||
tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
//
|
||||
// UpdatesAvailableDialog
|
||||
//
|
||||
AcceptButton = radButton_Install;
|
||||
resources.ApplyResources(this, "$this");
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
CancelButton = radButton_Cancel;
|
||||
Controls.Add(panel1);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
MaximizeBox = false;
|
||||
MinimizeBox = false;
|
||||
Controls.Add(tableLayoutPanel1);
|
||||
Name = "UpdatesAvailableDialog";
|
||||
panel1.ResumeLayout(false);
|
||||
panel1.PerformLayout();
|
||||
Controls.SetChildIndex(tableLayoutPanel1, 0);
|
||||
((System.ComponentModel.ISupportInitialize)radButton_Cancel).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)radButton_Install).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)radLabel10).EndInit();
|
||||
@@ -233,11 +230,10 @@ namespace Pilz.Updating.Client.GUI
|
||||
((System.ComponentModel.ISupportInitialize)radLabel2).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)radLabel1).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)radPictureBox1).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)this).EndInit();
|
||||
tableLayoutPanel1.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
private Panel panel1;
|
||||
private Telerik.WinControls.UI.RadPictureBox radPictureBox1;
|
||||
private Telerik.WinControls.UI.RadLabel radLabel1;
|
||||
private Telerik.WinControls.UI.RadLabel radLabel_CurrentVersion;
|
||||
@@ -257,5 +253,6 @@ namespace Pilz.Updating.Client.GUI
|
||||
private Telerik.WinControls.UI.RadLabel radLabel10;
|
||||
private Telerik.WinControls.UI.RadButton radButton_Cancel;
|
||||
private Telerik.WinControls.UI.RadButton radButton_Install;
|
||||
private TableLayoutPanel tableLayoutPanel1;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,29 @@
|
||||
using Pilz.Updating.GUIBase;
|
||||
using Pilz.UI.Telerik;
|
||||
using Pilz.UI.Telerik.Dialogs;
|
||||
using Pilz.Updating.GUIBase;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.Updating.Client.GUI;
|
||||
|
||||
internal partial class UpdatesAvailableDialog
|
||||
internal partial class UpdatesAvailableDialog : RadFlyoutBase
|
||||
{
|
||||
public UpdatesAvailableDialog(Image appIcon, string curVersion, string curChannel, string curBuild, string newVersion, string newChannel, string newBuild, UpdateNotes updateNotes, bool installAsAdmin)
|
||||
{
|
||||
InitializeComponent();
|
||||
ActionPanelVisible = false;
|
||||
|
||||
radButton_Cancel.SvgImage = GlobalSymbolFactory.Instance.GetSvgImage(GlobalSymbols.software_installer, SvgImageSize.Small);
|
||||
|
||||
if (installAsAdmin)
|
||||
radButton_Install.Image = BaseFeatures.GetUacShieldImage();
|
||||
else
|
||||
radButton_Install.SvgImage = GlobalSymbolFactory.Instance.GetSvgImage(GlobalSymbols.software_installer, SvgImageSize.Small);
|
||||
|
||||
if (appIcon == null)
|
||||
radPictureBox1.SvgImage = GlobalSymbolFactory.Instance.GetSvgImage(GlobalSymbols.software_installer, SvgImageSize.Large);
|
||||
else
|
||||
radPictureBox1.Image = appIcon;
|
||||
|
||||
radPictureBox1.Image = appIcon ?? Icon.ToBitmap();
|
||||
radLabel_CurrentVersion.Text = curVersion;
|
||||
radLabel_CurrentVersionChannel.Text = curChannel;
|
||||
radLabel_CurrentVersionBuild.Text = curBuild;
|
||||
@@ -20,34 +31,85 @@ internal partial class UpdatesAvailableDialog
|
||||
radLabel_AvailableVersionChannel.Text = newChannel;
|
||||
radLabel_AvailableVersionBuild.Text = newBuild;
|
||||
|
||||
// Update Notes
|
||||
Control updateNotesControl = null;
|
||||
SetNotes(updateNotes);
|
||||
}
|
||||
|
||||
private void SetNotes(UpdateNotes updateNotes)
|
||||
{
|
||||
// Internal
|
||||
if (updateNotes.Mode == UpdateNotesMode.Internal && !string.IsNullOrWhiteSpace(updateNotes.ContentUrl) && TryDownloadContent(updateNotes.ContentUrl) is string content)
|
||||
{
|
||||
switch (updateNotes.ContentType)
|
||||
{
|
||||
case UpdateNotesContentType.PlainText:
|
||||
var newUpdateNotesControl = new RadRichTextEditor
|
||||
SetNotesControls(new RadRichTextEditor
|
||||
{
|
||||
Text = updateNotes.Content
|
||||
};
|
||||
updateNotesControl = newUpdateNotesControl;
|
||||
break;
|
||||
Text = content
|
||||
});
|
||||
return;
|
||||
case UpdateNotesContentType.Markdown:
|
||||
updateNotesControl = new Westermo.HtmlRenderer.WinForms.HtmlPanel
|
||||
SetNotesControls(new Westermo.HtmlRenderer.WinForms.HtmlPanel
|
||||
{
|
||||
Text = Markdig.Markdown.ToHtml(updateNotes.Content)
|
||||
};
|
||||
break;
|
||||
Text = Markdig.Markdown.ToHtml(content)
|
||||
});
|
||||
return;
|
||||
case UpdateNotesContentType.HTML:
|
||||
updateNotesControl = new Westermo.HtmlRenderer.WinForms.HtmlPanel
|
||||
SetNotesControls(new Westermo.HtmlRenderer.WinForms.HtmlPanel
|
||||
{
|
||||
Text = updateNotes.Content
|
||||
};
|
||||
break;
|
||||
Text = content
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (updateNotesControl is not null)
|
||||
}
|
||||
|
||||
// External
|
||||
if (updateNotes.Mode == UpdateNotesMode.External && !string.IsNullOrWhiteSpace(updateNotes.ExternalUrl))
|
||||
{
|
||||
var label = new RadLabel
|
||||
{
|
||||
AutoSize = false,
|
||||
Text = string.Format(LangRes.NotesLinkToExternal, updateNotes.ExternalUrl),
|
||||
TextAlignment = ContentAlignment.MiddleCenter,
|
||||
};
|
||||
SetNotesControls(label);
|
||||
return;
|
||||
}
|
||||
|
||||
// None or not supported or fallback
|
||||
SetNotesControls(new RadLabel
|
||||
{
|
||||
AutoSize = false,
|
||||
Text = LangRes.NotesNotAvailable,
|
||||
TextAlignment = ContentAlignment.MiddleCenter,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
private void SetNotesControls(Control updateNotesControl)
|
||||
{
|
||||
updateNotesControl.Dock = DockStyle.Fill;
|
||||
panel_ChangelogPanel.Controls.Add(updateNotesControl);
|
||||
}
|
||||
|
||||
private static string TryDownloadContent(string contentUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new HttpClient().GetStringAsync(contentUrl).Result;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void RadButton_Install_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close(DialogResult.OK);
|
||||
}
|
||||
|
||||
private void RadButton_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close(DialogResult.Cancel);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
19
Pilz.Updating.GUIBase/GlobalSymbolFactory.cs
Normal file
19
Pilz.Updating.GUIBase/GlobalSymbolFactory.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Pilz.UI.Telerik;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Pilz.Updating.GUIBase;
|
||||
|
||||
public class GlobalSymbolFactory : SymbolFactory<GlobalSymbols>
|
||||
{
|
||||
public static GlobalSymbolFactory Instance { get; } = new();
|
||||
|
||||
public override Assembly GetSvgImageResourceAssembly()
|
||||
{
|
||||
return Assembly.GetExecutingAssembly();
|
||||
}
|
||||
|
||||
public override string GetSvgImageRessourcePath(GlobalSymbols svgImage)
|
||||
{
|
||||
return $"{GetType().Namespace}.Symbols.{Enum.GetName(svgImage)}.svg";
|
||||
}
|
||||
}
|
||||
7
Pilz.Updating.GUIBase/GlobalSymbols.cs
Normal file
7
Pilz.Updating.GUIBase/GlobalSymbols.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Pilz.Updating.GUIBase;
|
||||
|
||||
public enum GlobalSymbols
|
||||
{
|
||||
cancel,
|
||||
software_installer,
|
||||
}
|
||||
@@ -10,6 +10,10 @@
|
||||
<Version>2.0.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Symbols\*.svg" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -42,6 +46,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" />
|
||||
<PackageReference Include="Pilz.UI.Telerik.SymbolFactory" Version="2.0.3" />
|
||||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
</ItemGroup>
|
||||
|
||||
6
Pilz.Updating.GUIBase/Symbols/cancel.svg
Normal file
6
Pilz.Updating.GUIBase/Symbols/cancel.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="32" height="32">
|
||||
<path fill="#f44336" d="M44,24c0,11-9,20-20,20S4,35,4,24S13,4,24,4S44,13,44,24z" />
|
||||
<line x1="16.9" x2="31.1" y1="16.9" y2="31.1" fill="none" stroke="#fff" stroke-width="4" />
|
||||
<line x1="31.1" x2="16.9" y1="16.9" y2="31.1" fill="none" stroke="#fff" stroke-width="4" />
|
||||
</svg>
|
||||
8
Pilz.Updating.GUIBase/Symbols/software_installer.svg
Normal file
8
Pilz.Updating.GUIBase/Symbols/software_installer.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 48 48">
|
||||
<path fill="#78909C" d="M6,29v10c0,2.209,1.791,4,4,4h28c2.209,0,4-1.791,4-4V29H6z" />
|
||||
<path fill="#455A64" d="M42,29c0,2.209-1.791,4-4,4H10c-2.209,0-4-1.791-4-4l3-18c0.219-2.094,1.791-4,4-4h22c2.209,0,3.688,1.75,4,4L42,29z" />
|
||||
<path fill="#64DD17" d="M35 36A2 2 0 1 0 35 40A2 2 0 1 0 35 36Z" />
|
||||
<path fill="#00E5FF" d="M24.001 27.242L32 19.242 16 19.242z" />
|
||||
<path fill="#00E5FF" d="M21 4H26.998V19.999000000000002H21z" />
|
||||
</svg>
|
||||
Reference in New Issue
Block a user