mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix async void when it should be async Task, ignore the rest.
This commit is contained in:
@@ -679,11 +679,13 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
foreach(MediaTagType mediaTag in _inputFormat.Info.ReadableMediaTags.Where(mediaTag =>
|
foreach(MediaTagType mediaTag in _inputFormat.Info.ReadableMediaTags.Where(mediaTag =>
|
||||||
!outputFormat.SupportedMediaTags.Contains(mediaTag) && !ForceChecked))
|
!outputFormat.SupportedMediaTags.Contains(mediaTag) && !ForceChecked))
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Converting image will lose media tag {mediaTag}, not continuing...",
|
$"Converting image will lose media tag {
|
||||||
icon: Icon.Error).
|
mediaTag
|
||||||
ShowDialog(_view));
|
}, not continuing...",
|
||||||
|
icon: Icon.Error).
|
||||||
|
ShowDialog(_view));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -703,11 +705,11 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Converting image will lose sector tag {sectorTag}, not continuing...",
|
$"Converting image will lose sector tag {sectorTag}, not continuing...",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
ShowDialog(_view));
|
ShowDialog(_view));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -756,11 +758,13 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
if(!outputFormat.Create(DestinationText, _inputFormat.Info.MediaType, parsedOptions, _inputFormat.Info.Sectors,
|
if(!outputFormat.Create(DestinationText, _inputFormat.Info.MediaType, parsedOptions, _inputFormat.Info.Sectors,
|
||||||
_inputFormat.Info.SectorSize))
|
_inputFormat.Info.SectorSize))
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} creating output image.",
|
$"Error {outputFormat.
|
||||||
icon: Icon.Error).
|
ErrorMessage
|
||||||
ShowDialog(_view));
|
} creating output image.",
|
||||||
|
icon: Icon.Error).
|
||||||
|
ShowDialog(_view));
|
||||||
|
|
||||||
AaruConsole.ErrorWriteLine("Error {0} creating output image.", outputFormat.ErrorMessage);
|
AaruConsole.ErrorWriteLine("Error {0} creating output image.", outputFormat.ErrorMessage);
|
||||||
|
|
||||||
@@ -802,11 +806,11 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
|
|
||||||
if(ForceChecked != true)
|
if(ForceChecked != true)
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} setting metadata, not continuing...",
|
$"Error {outputFormat.ErrorMessage} setting metadata, not continuing...",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
ShowDialog(_view));
|
ShowDialog(_view));
|
||||||
|
|
||||||
AaruConsole.ErrorWriteLine("not continuing...");
|
AaruConsole.ErrorWriteLine("not continuing...");
|
||||||
|
|
||||||
@@ -831,11 +835,11 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
|
|
||||||
if(!outputOptical.SetTracks(tracks))
|
if(!outputOptical.SetTracks(tracks))
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} sending tracks list to output image.",
|
$"Error {outputFormat.ErrorMessage} sending tracks list to output image.",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
ShowDialog(_view));
|
ShowDialog(_view));
|
||||||
|
|
||||||
AaruConsole.ErrorWriteLine("Error {0} sending tracks list to output image.", outputFormat.ErrorMessage);
|
AaruConsole.ErrorWriteLine("Error {0} sending tracks list to output image.", outputFormat.ErrorMessage);
|
||||||
|
|
||||||
@@ -877,7 +881,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
{
|
{
|
||||||
if(errno == ErrorNumber.NoError)
|
if(errno == ErrorNumber.NoError)
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () =>
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() =>
|
||||||
await MessageBoxManager.
|
await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} writing media tag, not continuing...",
|
$"Error {outputFormat.ErrorMessage} writing media tag, not continuing...",
|
||||||
@@ -888,7 +892,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () =>
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() =>
|
||||||
await MessageBoxManager.
|
await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {errno} reading media tag, not continuing...",
|
$"Error {errno} reading media tag, not continuing...",
|
||||||
@@ -981,7 +985,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).ShowDialog(_view));
|
icon: Icon.Error).ShowDialog(_view));
|
||||||
@@ -1014,7 +1018,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).ShowDialog(_view));
|
icon: Icon.Error).ShowDialog(_view));
|
||||||
@@ -1037,7 +1041,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} writing sector {doneSectors}, not continuing...",
|
$"Error {outputFormat.ErrorMessage} writing sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).ShowDialog(_view));
|
icon: Icon.Error).ShowDialog(_view));
|
||||||
@@ -1195,7 +1199,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
@@ -1247,7 +1251,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
@@ -1271,7 +1275,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} writing sector {doneSectors}, not continuing...",
|
$"Error {outputFormat.ErrorMessage} writing sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).ShowDialog(_view));
|
icon: Icon.Error).ShowDialog(_view));
|
||||||
@@ -1376,7 +1380,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
@@ -1410,7 +1414,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
$"Error {errno} reading sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
@@ -1431,7 +1435,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} writing sector {doneSectors}, not continuing...",
|
$"Error {outputFormat.ErrorMessage} writing sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).ShowDialog(_view));
|
icon: Icon.Error).ShowDialog(_view));
|
||||||
@@ -1506,7 +1510,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () =>
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() =>
|
||||||
await MessageBoxManager.
|
await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {errno} reading tag, not continuing...",
|
$"Error {errno} reading tag, not continuing...",
|
||||||
@@ -1529,7 +1533,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () =>
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() =>
|
||||||
await MessageBoxManager.
|
await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} writing tag, not continuing...",
|
$"Error {outputFormat.ErrorMessage} writing tag, not continuing...",
|
||||||
@@ -1587,7 +1591,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {errno} reading tag for sector {doneSectors}, not continuing...",
|
$"Error {errno} reading tag for sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
@@ -1607,7 +1611,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} writing tag for sector {doneSectors}, not continuing...",
|
$"Error {outputFormat.ErrorMessage} writing tag for sector {doneSectors}, not continuing...",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
@@ -1672,7 +1676,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
|
|
||||||
if(_cancel)
|
if(_cancel)
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () =>
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() =>
|
||||||
{
|
{
|
||||||
await MessageBoxManager.
|
await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error", "Operation canceled, the output file is not correct.",
|
GetMessageBoxStandardWindow("Error", "Operation canceled, the output file is not correct.",
|
||||||
@@ -1688,16 +1692,16 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
|
|
||||||
if(!outputFormat.Close())
|
if(!outputFormat.Close())
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() => await MessageBoxManager.
|
||||||
GetMessageBoxStandardWindow("Error",
|
GetMessageBoxStandardWindow("Error",
|
||||||
$"Error {outputFormat.ErrorMessage} closing output image... Contents are not correct.",
|
$"Error {outputFormat.ErrorMessage} closing output image... Contents are not correct.",
|
||||||
icon: Icon.Error).
|
icon: Icon.Error).
|
||||||
ShowDialog(_view));
|
ShowDialog(_view));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await Dispatcher.UIThread.InvokeAsync(action: async () =>
|
await Dispatcher.UIThread.InvokeAsync(action: async Task() =>
|
||||||
{
|
{
|
||||||
await MessageBoxManager.GetMessageBoxStandardWindow(warning ? "Warning" : "Conversion success",
|
await MessageBoxManager.GetMessageBoxStandardWindow(warning ? "Warning" : "Conversion success",
|
||||||
warning
|
warning
|
||||||
|
|||||||
@@ -34,16 +34,17 @@ namespace Aaru.Gui.ViewModels.Windows;
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
using Aaru.Console;
|
using Aaru.Console;
|
||||||
using Aaru.Core;
|
using Aaru.Core;
|
||||||
using Aaru.Gui.Models;
|
using Aaru.Gui.Models;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
|
|
||||||
public sealed class ImageEntropyViewModel : ViewModelBase
|
public sealed class ImageEntropyViewModel : ViewModelBase
|
||||||
@@ -277,7 +278,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
|||||||
set => this.RaiseAndSetIfChanged(ref _progress2Value, value);
|
set => this.RaiseAndSetIfChanged(ref _progress2Value, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NotNull]
|
[JetBrains.Annotations.NotNull]
|
||||||
public string Title => "Calculating entropy";
|
public string Title => "Calculating entropy";
|
||||||
public ObservableCollection<TrackEntropyModel> TrackEntropy { get; }
|
public ObservableCollection<TrackEntropyModel> TrackEntropy { get; }
|
||||||
public ReactiveCommand<Unit, Unit> StartCommand { get; }
|
public ReactiveCommand<Unit, Unit> StartCommand { get; }
|
||||||
@@ -307,7 +308,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
|||||||
WholeDiscChecked = false;
|
WholeDiscChecked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var thread = new Thread(async () =>
|
var thread = new Thread(async Task() =>
|
||||||
{
|
{
|
||||||
if(SeparatedTracksChecked)
|
if(SeparatedTracksChecked)
|
||||||
{
|
{
|
||||||
@@ -381,6 +382,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
|||||||
|
|
||||||
void EndProgress2() => Progress2Visible = false;
|
void EndProgress2() => Progress2Visible = false;
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateProgress(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateProgress(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
ProgressText = text;
|
ProgressText = text;
|
||||||
@@ -399,6 +401,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
|||||||
ProgressValue = current;
|
ProgressValue = current;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateProgress2(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateProgress2(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress2Text = text;
|
Progress2Text = text;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ namespace Aaru.Gui.ViewModels.Windows;
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -219,6 +220,7 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
|||||||
|
|
||||||
void ExecuteStartCommand() => new Thread(DoWork).Start();
|
void ExecuteStartCommand() => new Thread(DoWork).Start();
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void DoWork()
|
async void DoWork()
|
||||||
{
|
{
|
||||||
// Prepare UI
|
// Prepare UI
|
||||||
@@ -262,11 +264,13 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
|||||||
Statistics.AddCommand("create-sidecar");
|
Statistics.AddCommand("create-sidecar");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void EndProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void EndProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress2Visible = false;
|
Progress2Visible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateProgress2(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateProgress2(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress2Text = text;
|
Progress2Text = text;
|
||||||
@@ -276,16 +280,19 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
|||||||
Progress2Value = current;
|
Progress2Value = current;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void InitProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void InitProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress2Visible = true;
|
Progress2Visible = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void EndProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void EndProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress1Visible = false;
|
Progress1Visible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateProgress(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateProgress(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
ProgressText = text;
|
ProgressText = text;
|
||||||
@@ -295,11 +302,13 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
|||||||
ProgressValue = current;
|
ProgressValue = current;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void InitProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void InitProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress1Visible = true;
|
Progress1Visible = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateStatus(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateStatus(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
StatusText = text;
|
StatusText = text;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ namespace Aaru.Gui.ViewModels.Windows;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
@@ -343,6 +344,7 @@ public sealed class ImageVerifyViewModel : ViewModelBase
|
|||||||
new Thread(DoWork).Start();
|
new Thread(DoWork).Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void DoWork()
|
async void DoWork()
|
||||||
{
|
{
|
||||||
bool formatHasTracks;
|
bool formatHasTracks;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ namespace Aaru.Gui.ViewModels.Windows;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
@@ -817,6 +818,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
|||||||
new Thread(DoWork).Start();
|
new Thread(DoWork).Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void DoWork()
|
async void DoWork()
|
||||||
{
|
{
|
||||||
_dumper.UpdateStatus += UpdateStatus;
|
_dumper.UpdateStatus += UpdateStatus;
|
||||||
@@ -845,11 +847,13 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
|||||||
Progress2Visible = false;
|
Progress2Visible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void EndProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void EndProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress2Visible = false;
|
Progress2Visible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateProgress2(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateProgress2(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress2Text = text;
|
Progress2Text = text;
|
||||||
@@ -859,16 +863,19 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
|||||||
Progress2Value = current;
|
Progress2Value = current;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void InitProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void InitProgress2() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress2Visible = true;
|
Progress2Visible = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void EndProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void EndProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress1Visible = false;
|
Progress1Visible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateProgress(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateProgress(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
ProgressText = text;
|
ProgressText = text;
|
||||||
@@ -878,17 +885,20 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
|||||||
ProgressValue = current;
|
ProgressValue = current;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void InitProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void InitProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress1Visible = true;
|
Progress1Visible = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void PulseProgress(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void PulseProgress(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
ProgressText = text;
|
ProgressText = text;
|
||||||
ProgressIndeterminate = true;
|
ProgressIndeterminate = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void StoppingErrorMessage(string text) => await Dispatcher.UIThread.InvokeAsync(async () =>
|
async void StoppingErrorMessage(string text) => await Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
{
|
{
|
||||||
ErrorMessage(text);
|
ErrorMessage(text);
|
||||||
@@ -899,11 +909,13 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
|||||||
await WorkFinished();
|
await WorkFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void ErrorMessage(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void ErrorMessage(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Log += text + Environment.NewLine;
|
Log += text + Environment.NewLine;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateStatus(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateStatus(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Log += text + Environment.NewLine;
|
Log += text + Environment.NewLine;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
namespace Aaru.Gui.ViewModels.Windows;
|
namespace Aaru.Gui.ViewModels.Windows;
|
||||||
|
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -321,6 +322,7 @@ public sealed class MediaScanViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Allow to save MHDD and ImgBurn log files
|
// TODO: Allow to save MHDD and ImgBurn log files
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void DoWork()
|
async void DoWork()
|
||||||
{
|
{
|
||||||
if(_devicePath.Length == 2 &&
|
if(_devicePath.Length == 2 &&
|
||||||
@@ -421,6 +423,7 @@ public sealed class MediaScanViewModel : ViewModelBase
|
|||||||
await WorkFinished();
|
await WorkFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void ScanSpeed(ulong sector, double currentSpeed) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void ScanSpeed(ulong sector, double currentSpeed) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
if(ChartPoints.Count == 0)
|
if(ChartPoints.Count == 0)
|
||||||
@@ -432,6 +435,7 @@ public sealed class MediaScanViewModel : ViewModelBase
|
|||||||
MaxY = currentSpeed + currentSpeed / 10d;
|
MaxY = currentSpeed + currentSpeed / 10d;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void InitBlockMap(ulong blocks, ulong blockSize, ulong blocksToRead, ushort currentProfile) =>
|
async void InitBlockMap(ulong blocks, ulong blockSize, ulong blocksToRead, ushort currentProfile) =>
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
@@ -542,11 +546,13 @@ public sealed class MediaScanViewModel : ViewModelBase
|
|||||||
ProgressVisible = false;
|
ProgressVisible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void EndProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void EndProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress1Visible = false;
|
Progress1Visible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateProgress(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateProgress(string text, long current, long maximum) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
ProgressText = text;
|
ProgressText = text;
|
||||||
@@ -556,18 +562,21 @@ public sealed class MediaScanViewModel : ViewModelBase
|
|||||||
ProgressValue = current;
|
ProgressValue = current;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void InitProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void InitProgress() => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Progress1Visible = true;
|
Progress1Visible = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void PulseProgress(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void PulseProgress(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
ProgressText = text;
|
ProgressText = text;
|
||||||
ProgressIndeterminate = true;
|
ProgressIndeterminate = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
async void StoppingErrorMessage(string text) => await Dispatcher.UIThread.InvokeAsync(action: async () =>
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
|
async void StoppingErrorMessage(string text) => await Dispatcher.UIThread.InvokeAsync(action: async Task() =>
|
||||||
{
|
{
|
||||||
ProgressText = text;
|
ProgressText = text;
|
||||||
|
|
||||||
@@ -577,11 +586,13 @@ public sealed class MediaScanViewModel : ViewModelBase
|
|||||||
WorkFinished();
|
WorkFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void UpdateStatus(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void UpdateStatus(string text) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
ProgressText = text;
|
ProgressText = text;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void OnScanUnreadable(ulong sector) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void OnScanUnreadable(ulong sector) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
_localResults.Errored += _blocksToRead;
|
_localResults.Errored += _blocksToRead;
|
||||||
@@ -589,6 +600,7 @@ public sealed class MediaScanViewModel : ViewModelBase
|
|||||||
BlockMapList.Add((sector / _blocksToRead, double.NaN));
|
BlockMapList.Add((sector / _blocksToRead, double.NaN));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||||
async void OnScanTime(ulong sector, double duration) => await Dispatcher.UIThread.InvokeAsync(() =>
|
async void OnScanTime(ulong sector, double duration) => await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
BlockMapList.Add((sector / _blocksToRead, duration));
|
BlockMapList.Add((sector / _blocksToRead, duration));
|
||||||
|
|||||||
Reference in New Issue
Block a user