Added Prism to example, Added ability to filter files and minor bugfixes

This commit is contained in:
Holger Boerchers
2018-07-28 23:57:14 +02:00
parent a18f7b0837
commit 0ed81d68c8
38 changed files with 15713 additions and 44 deletions

View File

@@ -83,9 +83,15 @@ namespace Katteker
private async void UpdateWindow_Load(object sender, EventArgs e)
{
var changelogContent = await ChangelogHelper.LoadChangelogAsync(Changelog, PublishPath).ConfigureAwait(false);
var changelogContent = "No changelog provided.";
if (Changelog != null)
{
changelogContent = await ChangelogHelper.LoadChangelogAsync(Changelog, PublishPath).ConfigureAwait(false);
}
changelogContent = changelogContent.ChangelogAsHtml(Path.GetExtension(Changelog));
Invoke(new Action(() => changelogBrowser.DocumentText = changelogContent));
if (_entry == null)
{
Invoke(new Action(() => { WriteTitle(Resources.No_update_available); }));

View File

@@ -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();
}
}
}