1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-08-30 02:53:11 +02:00

Refactor UpdateHandler to not expose UpdaterSettings

This commit is contained in:
2017-03-22 12:49:10 +01:00
parent 8036659003
commit d9b9afbf2d
3 changed files with 11 additions and 15 deletions

@@ -338,10 +338,7 @@ namespace TweetDck.Core{
currentFormSettings = null;
if (!prevEnableUpdateCheck && Config.EnableUpdateCheck){
updates.Settings.DismissedUpdate = string.Empty;
Config.DismissedUpdate = string.Empty;
Config.Save();
updates.DismissUpdate(string.Empty);
updates.Check(false);
}

@@ -77,10 +77,7 @@ namespace TweetDck.Core.Other.Settings{
}
else{
btnCheckUpdates.Enabled = false;
updates.Settings.DismissedUpdate = string.Empty;
Config.DismissedUpdate = string.Empty;
Config.Save();
updates.DismissUpdate(string.Empty);
}
}

@@ -8,19 +8,13 @@ using TweetDck.Resources;
using TweetDck.Updates.Events;
namespace TweetDck.Updates{
class UpdateHandler{
sealed class UpdateHandler{
private static bool IsSystemSupported{
get{
return true; // Environment.OSVersion.Version >= new Version("6.1"); // 6.1 NT version = Windows 7
}
}
public UpdaterSettings Settings{
get{
return settings;
}
}
private readonly ChromiumWebBrowser browser;
private readonly FormBrowser form;
private readonly UpdaterSettings settings;
@@ -65,6 +59,14 @@ namespace TweetDck.Updates{
return -1;
}
public void DismissUpdate(string tag){
settings.DismissedUpdate = tag;
if (UpdateDismissed != null){
UpdateDismissed(this, new UpdateDismissedEventArgs(tag));
}
}
private void TriggerUpdateAcceptedEvent(UpdateAcceptedEventArgs args){
if (UpdateAccepted != null){
form.InvokeAsyncSafe(() => UpdateAccepted(this, args));