Added Prism to example, Added ability to filter files and minor bugfixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
@@ -12,6 +13,7 @@ namespace Katteker
|
||||
public static class UserInterface
|
||||
{
|
||||
private static UpdateManager _manager;
|
||||
private static Action _restartApp;
|
||||
|
||||
/// <summary>
|
||||
/// Checks for Updates.
|
||||
@@ -38,6 +40,7 @@ namespace Katteker
|
||||
}
|
||||
|
||||
var releases = (await _manager.CheckForUpdateAsync().ConfigureAwait(false)).ToArray();
|
||||
_restartApp = () => _manager.RestartApp();
|
||||
if (releases.Any() || !isStartup)
|
||||
{
|
||||
var thread = new Thread(ThreadProcess);
|
||||
@@ -49,13 +52,13 @@ namespace Katteker
|
||||
|
||||
private static void ThreadProcess(object argument)
|
||||
{
|
||||
var entry = (ReleaseEntry) argument;
|
||||
var entry = argument as ReleaseEntry;
|
||||
using (var window = new UpdateWindow(_manager, entry))
|
||||
{
|
||||
var dialogResult = window.ShowDialog();
|
||||
if (dialogResult == DialogResult.OK)
|
||||
{
|
||||
_manager.RestartApp();
|
||||
_restartApp?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user