Update workflows

This commit is contained in:
MBucari 2023-02-27 16:38:18 -07:00 committed by Mbucari
parent 80ea394934
commit 429aa603f5
27 changed files with 159 additions and 156 deletions

View file

@ -1,4 +1,5 @@
<root>
<?xml version="1.0" encoding="utf-8"?>
<root>
<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">

View file

@ -6,29 +6,30 @@ namespace LibationWinForms
{
public partial class Form1
{
private void Configure_Update()
private void Configure_Upgrade()
{
setProgressVisible(false);
#if !DEBUG
Task upgradeAvailable(UpgradeEventArgs e)
{
var notificationResult = new UpgradeNotificationDialog(e.UpgradeProperties).ShowDialog(this);
e.Ignore = notificationResult == System.Windows.Forms.DialogResult.Ignore;
e.InstallUpgrade = notificationResult == System.Windows.Forms.DialogResult.Yes;
return Task.CompletedTask;
}
var upgrader = new Upgrader();
upgrader.DownloadProgress += (_, e) => Invoke(() => upgradePb.Value = int.Max(0, int.Min(100, (int)(e.ProgressPercentage ?? 0))));
upgrader.DownloadBegin += (_, _) => Invoke(() => setProgressVisible(true));
upgrader.DownloadCompleted += (_, _) => Invoke(() => setProgressVisible(false));
Shown += async (_, _) => await upgrader.CheForUpgradeAsync(UpgradeAvailable);
Shown += async (_, _) => await upgrader.CheForUpgradeAsync(upgradeAvailable);
#endif
}
private void setProgressVisible(bool visible) => upgradeLbl.Visible = upgradePb.Visible = visible;
private Task UpgradeAvailable(UpgradeEventArgs e)
{
var notificationResult = new UpgradeNotificationDialog(e.UpgradeProperties).ShowDialog(this);
e.Ignore = notificationResult == System.Windows.Forms.DialogResult.Ignore;
e.InstallUpdate = notificationResult == System.Windows.Forms.DialogResult.Yes;
return Task.CompletedTask;
}
}
}

View file

@ -51,7 +51,7 @@ namespace LibationWinForms
Configure_Settings();
Configure_ProcessQueue();
Configure_Filter();
Configure_Update();
Configure_Upgrade();
// misc which belongs in winforms app but doesn't have a UI element
Configure_NonUI();

View file

@ -1,7 +1,6 @@
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using Dinah.Core.WindowsDesktop;
using LibationFileManager;
namespace LibationWinForms