General code cleanup and style refactor.

This commit is contained in:
2022-11-15 15:58:43 +00:00
parent f59ecffb59
commit 2f9b7fe0a1
1324 changed files with 36815 additions and 37688 deletions

View File

@@ -30,8 +30,6 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Gui.ViewModels.Windows;
using System;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
@@ -48,6 +46,8 @@ using Avalonia.Threading;
using ReactiveUI;
using Schemas;
namespace Aaru.Gui.ViewModels.Windows;
public sealed class ImageChecksumViewModel : ViewModelBase
{
// How many sectors to read at once
@@ -371,8 +371,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void DoWork()
{
var opticalMediaImage = _inputFormat as IOpticalMediaImage;
var formatHasTracks = false;
var opticalMediaImage = _inputFormat as IOpticalMediaImage;
bool formatHasTracks = false;
if(opticalMediaImage != null)
try
@@ -533,8 +533,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
{
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
Progress2Text =
$"Hashing sectors {doneSectorsToInvoke} to {doneSectorsToInvoke + SECTORS_TO_READ} of track {currentTrack.Sequence}";
Progress2Text = $"Hashing sectors {doneSectorsToInvoke} to {
doneSectorsToInvoke + SECTORS_TO_READ} of track {currentTrack.Sequence}";
});
doneSectors += SECTORS_TO_READ;
@@ -558,8 +558,9 @@ public sealed class ImageChecksumViewModel : ViewModelBase
{
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
Progress2Text =
$"Hashing sectors {doneSectorsToInvoke} to {doneSectorsToInvoke + (sectors - doneSectorsToInvoke)} of track {currentTrack.Sequence}";
Progress2Text = $"Hashing sectors {doneSectorsToInvoke} to {
doneSectorsToInvoke + (sectors - doneSectorsToInvoke)} of track {
currentTrack.Sequence}";
});
doneSectors += sectors - doneSectors;
@@ -679,8 +680,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
{
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
Progress2Text =
$"Hashing sectors {doneSectorsToInvoke} to {doneSectorsToInvoke + SECTORS_TO_READ}";
Progress2Text = $"Hashing sectors {doneSectorsToInvoke} to {
doneSectorsToInvoke + SECTORS_TO_READ}";
});
doneSectors += SECTORS_TO_READ;
@@ -704,8 +705,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
{
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
Progress2Text =
$"Hashing sectors {doneSectorsToInvoke} to {doneSectorsToInvoke + (_inputFormat.Info.Sectors - doneSectorsToInvoke)}";
Progress2Text = $"Hashing sectors {doneSectorsToInvoke} to {
doneSectorsToInvoke + (_inputFormat.Info.Sectors - doneSectorsToInvoke)}";
});
doneSectors += _inputFormat.Info.Sectors - doneSectors;