diff --git a/mRemoteNG/App/Startup.cs b/mRemoteNG/App/Startup.cs index ee6a6816e..e7a13bce0 100644 --- a/mRemoteNG/App/Startup.cs +++ b/mRemoteNG/App/Startup.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Globalization; +using System.Threading.Tasks; using mRemoteNG.App.Info; using mRemoteNG.App.Initialization; using mRemoteNG.App.Update; @@ -65,7 +66,7 @@ namespace mRemoteNG.App Runtime.ConnectionsService.RemoteConnectionsSyncronizer.Enable(); } - public async void CheckForUpdate() + public async Task CheckForUpdate() { if (_appUpdate == null) { diff --git a/mRemoteNG/App/Update/AppUpdater.cs b/mRemoteNG/App/Update/AppUpdater.cs index 400f56208..a878e28cc 100644 --- a/mRemoteNG/App/Update/AppUpdater.cs +++ b/mRemoteNG/App/Update/AppUpdater.cs @@ -38,7 +38,6 @@ namespace mRemoteNG.App.Update get { return _getUpdateInfoCancelToken != null; - } } diff --git a/mRemoteNG/UI/Forms/frmMain.cs b/mRemoteNG/UI/Forms/frmMain.cs index 05642c5ad..d8c25c3ee 100644 --- a/mRemoteNG/UI/Forms/frmMain.cs +++ b/mRemoteNG/UI/Forms/frmMain.cs @@ -25,6 +25,7 @@ using System.Globalization; using System.IO; using System.Runtime.InteropServices; using System.Text; +using System.Threading.Tasks; using System.Windows.Forms; using mRemoteNG.UI.Panels; using WeifenLuo.WinFormsUI.Docking; @@ -342,7 +343,7 @@ namespace mRemoteNG.UI.Forms private async void frmMain_Shown(object sender, EventArgs e) { PromptForUpdatesPreference(); - CheckForUpdates(); + await CheckForUpdates(); } private void PromptForUpdatesPreference() @@ -374,7 +375,7 @@ namespace mRemoteNG.UI.Forms } } - private async void CheckForUpdates() + private async Task CheckForUpdates() { if (!Settings.Default.CheckForUpdatesOnStartup) return; @@ -385,7 +386,7 @@ namespace mRemoteNG.UI.Forms if (!IsHandleCreated) CreateHandle(); // Make sure the handle is created so that InvokeRequired returns the correct result - Startup.Instance.CheckForUpdate(); + await Startup.Instance.CheckForUpdate(); } private void frmMain_FormClosing(object sender, FormClosingEventArgs e) diff --git a/mRemoteNG/UI/Window/UpdateWindow.cs b/mRemoteNG/UI/Window/UpdateWindow.cs index 6adfeb2c1..8553b3a09 100644 --- a/mRemoteNG/UI/Window/UpdateWindow.cs +++ b/mRemoteNG/UI/Window/UpdateWindow.cs @@ -44,7 +44,7 @@ namespace mRemoteNG.UI.Window ApplyTheme(); ThemeManager.getInstance().ThemeChanged += ApplyTheme; ApplyLanguage(); - CheckForUpdateAsync(); + await CheckForUpdateAsync(); } private new void ApplyTheme() @@ -73,9 +73,9 @@ namespace mRemoteNG.UI.Window lblLatestVersionLabel.Text = $"{Language.AvailableVersion}:"; } - private void btnCheckForUpdate_Click(object sender, EventArgs e) + private async void btnCheckForUpdate_Click(object sender, EventArgs e) { - CheckForUpdateAsync(); + await CheckForUpdateAsync(); } private async void btnDownload_Click(object sender, EventArgs e) @@ -98,7 +98,7 @@ namespace mRemoteNG.UI.Window #region Private Methods - private async void CheckForUpdateAsync() + private async Task CheckForUpdateAsync() { if (_appUpdate == null) {