From 9f1be99527e6bb3de38bf345a8cd583e9125ba0f Mon Sep 17 00:00:00 2001 From: Vitaly Zaitsev Date: Tue, 18 Jul 2023 12:45:25 +0200 Subject: [PATCH] Switched "Updater" module to correct async+await usage. Closes #563. --- src/srcrepair/FrmUpdate.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/srcrepair/FrmUpdate.cs b/src/srcrepair/FrmUpdate.cs index 058931ea..bd70cefe 100644 --- a/src/srcrepair/FrmUpdate.cs +++ b/src/srcrepair/FrmUpdate.cs @@ -80,11 +80,11 @@ private void UpdateTimeSetApp() /// Launches a program update checker in a separate thread, waits for the /// result and returns a message if found. /// - private async void CheckForUpdates() + private async Task CheckForUpdates() { try { - if (await CheckForUpdatesTask(UserAgent)) + if (await IsUpdatesAvailable(UserAgent)) { UpdAppImg.Image = Properties.Resources.IconUpdateAvailable; UpdAppStatus.Text = string.Format(AppStrings.UPD_AppUpdateAvail, UpMan.AppUpdateVersion); @@ -110,7 +110,7 @@ private async void CheckForUpdates() /// /// User-Agent header for outgoing HTTP queries. /// Returns True if updates were found. - private async Task CheckForUpdatesTask(string UA) + private async Task IsUpdatesAvailable(string UA) { UpMan = await UpdateManager.Create(UA); return UpMan.CheckAppUpdate(); @@ -197,10 +197,10 @@ private bool InstallBinaryUpdate(string UpdateURL) /// /// Sender object. /// Event arguments. - private void FrmUpdate_Load(object sender, EventArgs e) + private async void FrmUpdate_Load(object sender, EventArgs e) { // Starting checking for updates... - CheckForUpdates(); + await CheckForUpdates(); } ///