Corrected warnings related to async event handlers

Signed-off-by: Vest <Vest@users.noreply.github.com>
This commit is contained in:
Vest
2021-12-16 16:41:00 +01:00
parent 68dd6b1e23
commit 2bdfd7401e
4 changed files with 10 additions and 9 deletions

View File

@@ -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)
{

View File

@@ -38,7 +38,6 @@ namespace mRemoteNG.App.Update
get
{
return _getUpdateInfoCancelToken != null;
}
}

View File

@@ -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)

View File

@@ -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)
{