Fix async void when it should be async Task, ignore the rest.

This commit is contained in:
2022-11-14 01:38:50 +00:00
parent a9726d0661
commit 8a511d0d44
6 changed files with 93 additions and 51 deletions

View File

@@ -35,6 +35,7 @@ namespace Aaru.Gui.ViewModels.Windows;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reactive;
@@ -817,6 +818,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
new Thread(DoWork).Start();
}
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void DoWork()
{
_dumper.UpdateStatus += UpdateStatus;
@@ -845,11 +847,13 @@ public sealed class MediaDumpViewModel : ViewModelBase
Progress2Visible = false;
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void EndProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
{
Progress2Visible = false;
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void UpdateProgress2(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
{
Progress2Text = text;
@@ -859,16 +863,19 @@ public sealed class MediaDumpViewModel : ViewModelBase
Progress2Value = current;
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void InitProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
{
Progress2Visible = true;
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void EndProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
{
Progress1Visible = false;
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void UpdateProgress(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
{
ProgressText = text;
@@ -878,17 +885,20 @@ public sealed class MediaDumpViewModel : ViewModelBase
ProgressValue = current;
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void InitProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
{
Progress1Visible = true;
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void PulseProgress(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
{
ProgressText = text;
ProgressIndeterminate = true;
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void StoppingErrorMessage(string text) => await Dispatcher.UIThread.InvokeAsync(async () =>
{
ErrorMessage(text);
@@ -899,11 +909,13 @@ public sealed class MediaDumpViewModel : ViewModelBase
await WorkFinished();
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void ErrorMessage(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
{
Log += text + Environment.NewLine;
});
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void UpdateStatus(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
{
Log += text + Environment.NewLine;