gui: add event to handle EndUpdating
This commit is contained in:
@@ -1,13 +1,16 @@
|
|||||||
using Pilz.UI;
|
using Pilz.UI;
|
||||||
using Pilz.UI.Telerik.Dialogs;
|
using Pilz.UI.Telerik.Dialogs;
|
||||||
using Pilz.Updating.Client.Gui.LangRes;
|
using Pilz.Updating.Client.Gui.LangRes;
|
||||||
using Pilz.Updating.Client.GUI;
|
|
||||||
using Telerik.WinControls;
|
using Telerik.WinControls;
|
||||||
|
|
||||||
namespace Pilz.Updating.Client.Gui;
|
namespace Pilz.Updating.Client.Gui;
|
||||||
|
|
||||||
public class UpdateClientGui
|
public class UpdateClientGui
|
||||||
{
|
{
|
||||||
|
// E v e n t s
|
||||||
|
|
||||||
|
public event UpdateEndedEventHandler OnUpdateEnded;
|
||||||
|
|
||||||
// F i e l d s
|
// F i e l d s
|
||||||
|
|
||||||
private Form parentForm;
|
private Form parentForm;
|
||||||
@@ -16,7 +19,7 @@ public class UpdateClientGui
|
|||||||
|
|
||||||
// P r o p e r t i e s
|
// P r o p e r t i e s
|
||||||
|
|
||||||
public bool UseHiddenSearch { get; set; } = false;
|
public bool UseHiddenSearch { get; set; }
|
||||||
|
|
||||||
private static Image MyAppIcon => Icon.ExtractAssociatedIcon(IO.Extensions.GetExecutablePath()).ToBitmap();
|
private static Image MyAppIcon => Icon.ExtractAssociatedIcon(IO.Extensions.GetExecutablePath()).ToBitmap();
|
||||||
|
|
||||||
@@ -42,9 +45,15 @@ public class UpdateClientGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void EndUpdating()
|
private void EndUpdating()
|
||||||
|
{
|
||||||
|
EndUpdating(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EndUpdating(bool success)
|
||||||
{
|
{
|
||||||
curProgressDialog.AllowClose = true;
|
curProgressDialog.AllowClose = true;
|
||||||
curProgressDialog?.Invoke(curProgressDialog.Close);
|
curProgressDialog?.Invoke(curProgressDialog.Close);
|
||||||
|
OnUpdateEnded?.Invoke(this, new(success));
|
||||||
}
|
}
|
||||||
|
|
||||||
// E v e n t s
|
// E v e n t s
|
||||||
@@ -86,6 +95,8 @@ public class UpdateClientGui
|
|||||||
switch (e.Status)
|
switch (e.Status)
|
||||||
{
|
{
|
||||||
case UpdateStatus.Done:
|
case UpdateStatus.Done:
|
||||||
|
EndUpdating(true);
|
||||||
|
break;
|
||||||
case UpdateStatus.Failed:
|
case UpdateStatus.Failed:
|
||||||
case UpdateStatus.Canceled:
|
case UpdateStatus.Canceled:
|
||||||
EndUpdating();
|
EndUpdating();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Microsoft.VisualBasic.CompilerServices;
|
using Microsoft.VisualBasic.CompilerServices;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Pilz.Updating.Client.GUI
|
namespace Pilz.Updating.Client.Gui
|
||||||
{
|
{
|
||||||
[DesignerGenerated()]
|
[DesignerGenerated()]
|
||||||
internal partial class UpdatesAvailableDialog
|
internal partial class UpdatesAvailableDialog
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Pilz.Updating.Client.Gui.LangRes;
|
|||||||
using Pilz.Updating.GUIBase;
|
using Pilz.Updating.GUIBase;
|
||||||
using Telerik.WinControls.UI;
|
using Telerik.WinControls.UI;
|
||||||
|
|
||||||
namespace Pilz.Updating.Client.GUI;
|
namespace Pilz.Updating.Client.Gui;
|
||||||
|
|
||||||
internal partial class UpdatesAvailableDialog : RadFlyoutBase
|
internal partial class UpdatesAvailableDialog : RadFlyoutBase
|
||||||
{
|
{
|
||||||
|
|||||||
3
Pilz.Updating.Client.Gui/Delegates.cs
Normal file
3
Pilz.Updating.Client.Gui/Delegates.cs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
namespace Pilz.Updating.Client.Gui;
|
||||||
|
|
||||||
|
public delegate void UpdateEndedEventHandler(object sender, UpdateEndedEventArgs e);
|
||||||
6
Pilz.Updating.Client.Gui/UpdateEndedEventArgs.cs
Normal file
6
Pilz.Updating.Client.Gui/UpdateEndedEventArgs.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Pilz.Updating.Client.Gui;
|
||||||
|
|
||||||
|
public class UpdateEndedEventArgs(bool success) : EventArgs
|
||||||
|
{
|
||||||
|
public bool Success { get; } = success;
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ using System.Diagnostics;
|
|||||||
namespace Pilz.Updating.Client.Gui
|
namespace Pilz.Updating.Client.Gui
|
||||||
{
|
{
|
||||||
[DesignerGenerated()]
|
[DesignerGenerated()]
|
||||||
public partial class UpdateWindow
|
internal partial class UpdateWindow
|
||||||
{
|
{
|
||||||
|
|
||||||
// Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
// Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Telerik.WinControls;
|
|||||||
|
|
||||||
namespace Pilz.Updating.Client.Gui;
|
namespace Pilz.Updating.Client.Gui;
|
||||||
|
|
||||||
public partial class UpdateWindow : Telerik.WinControls.UI.RadForm
|
internal partial class UpdateWindow : Telerik.WinControls.UI.RadForm
|
||||||
{
|
{
|
||||||
// P r o p e r t i e s
|
// P r o p e r t i e s
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user