Files
Aaru/Aaru.Gui/ViewModels/Windows/ImageChecksumViewModel.cs

751 lines
25 KiB
C#
Raw Normal View History

2020-04-17 21:45:50 +01:00
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : ImageChecksumViewModel.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : GUI view models.
//
// --[ Description ] ----------------------------------------------------------
//
// View model and code for the image checksum window.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General public License for more details.
//
// You should have received a copy of the GNU General public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2022-02-18 10:02:53 +00:00
// Copyright © 2011-2022 Natalia Portillo
2020-04-17 21:45:50 +01:00
// ****************************************************************************/
2022-03-07 07:36:44 +00:00
namespace Aaru.Gui.ViewModels.Windows;
using System;
using System.Collections.ObjectModel;
using System.Reactive;
using System.Threading;
using System.Threading.Tasks;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using Aaru.Console;
using Aaru.Core;
using Aaru.Gui.Models;
using Avalonia.Controls;
using Avalonia.Threading;
using ReactiveUI;
using Schemas;
2022-03-06 13:29:38 +00:00
public sealed class ImageChecksumViewModel : ViewModelBase
{
// How many sectors to read at once
const uint SECTORS_TO_READ = 256;
readonly IMediaImage _inputFormat;
readonly Window _view;
bool _adler32Checked;
bool _cancel;
bool _checksumMediaChecked;
bool _checksumTracksChecked;
bool _checksumTracksVisible;
bool _closeCommandEnabled;
bool _closeCommandVisible;
bool _crc16Checked;
bool _crc32Checked;
bool _crc64Checked;
bool _fletcher16Checked;
bool _fletcher32Checked;
bool _md5Checked;
bool _mediaChecksumsVisible;
bool _optionsEnabled;
bool _progress1Visible;
double _progress2Max;
string _progress2Text;
double _progress2Value;
bool _progress2Visible;
double _progressMax;
string _progressText;
double _progressValue;
bool _progressVisible;
bool _resultsVisible;
bool _sha1Checked;
bool _sha256Checked;
bool _sha384Checked;
bool _sha512Checked;
bool _spamsumChecked;
bool _startCommandEnabled;
bool _startCommandVisible;
bool _stopCommandEnabled;
bool _stopCommandVisible;
string _title;
bool _trackChecksumsVisible;
public ImageChecksumViewModel(IMediaImage inputFormat, Window view)
{
_view = view;
_cancel = false;
_inputFormat = inputFormat;
ChecksumTracksChecked = ChecksumTracksVisible;
OptionsEnabled = true;
ChecksumMediaChecked = true;
ChecksumTracksChecked = true;
Adler32Checked = true;
Crc16Checked = true;
Crc32Checked = true;
Md5Checked = true;
Sha1Checked = true;
SpamsumChecked = true;
TrackChecksums = new ObservableCollection<ChecksumModel>();
MediaChecksums = new ObservableCollection<ChecksumModel>();
StartCommand = ReactiveCommand.Create(ExecuteStartCommand);
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
StopCommand = ReactiveCommand.Create(ExecuteStopCommand);
StopCommandVisible = false;
StartCommandVisible = true;
CloseCommandVisible = true;
StopCommandEnabled = true;
StartCommandEnabled = true;
CloseCommandEnabled = true;
try
{
ChecksumTracksVisible = (inputFormat as IOpticalMediaImage)?.Tracks?.Count > 0;
}
catch
{
ChecksumTracksVisible = false;
}
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
public string Title
{
get => _title;
set => this.RaiseAndSetIfChanged(ref _title, value);
}
2022-03-06 13:29:38 +00:00
public bool OptionsEnabled
{
get => _optionsEnabled;
set => this.RaiseAndSetIfChanged(ref _optionsEnabled, value);
}
2022-03-06 13:29:38 +00:00
public bool ChecksumMediaChecked
{
get => _checksumMediaChecked;
set => this.RaiseAndSetIfChanged(ref _checksumMediaChecked, value);
}
2022-03-06 13:29:38 +00:00
public bool ChecksumTracksChecked
{
get => _checksumTracksChecked;
set => this.RaiseAndSetIfChanged(ref _checksumTracksChecked, value);
}
2022-03-06 13:29:38 +00:00
public bool Adler32Checked
{
get => _adler32Checked;
set => this.RaiseAndSetIfChanged(ref _adler32Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Crc16Checked
{
get => _crc16Checked;
set => this.RaiseAndSetIfChanged(ref _crc16Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Crc32Checked
{
get => _crc32Checked;
set => this.RaiseAndSetIfChanged(ref _crc32Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Crc64Checked
{
get => _crc64Checked;
set => this.RaiseAndSetIfChanged(ref _crc64Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Fletcher16Checked
{
get => _fletcher16Checked;
set => this.RaiseAndSetIfChanged(ref _fletcher16Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Fletcher32Checked
{
get => _fletcher32Checked;
set => this.RaiseAndSetIfChanged(ref _fletcher32Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Md5Checked
{
get => _md5Checked;
set => this.RaiseAndSetIfChanged(ref _md5Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Sha1Checked
{
get => _sha1Checked;
set => this.RaiseAndSetIfChanged(ref _sha1Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Sha256Checked
{
get => _sha256Checked;
set => this.RaiseAndSetIfChanged(ref _sha256Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Sha384Checked
{
get => _sha384Checked;
set => this.RaiseAndSetIfChanged(ref _sha384Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool Sha512Checked
{
get => _sha512Checked;
set => this.RaiseAndSetIfChanged(ref _sha512Checked, value);
}
2022-03-06 13:29:38 +00:00
public bool SpamsumChecked
{
get => _spamsumChecked;
set => this.RaiseAndSetIfChanged(ref _spamsumChecked, value);
}
2022-03-06 13:29:38 +00:00
public bool ResultsVisible
{
get => _resultsVisible;
set => this.RaiseAndSetIfChanged(ref _resultsVisible, value);
}
2022-03-06 13:29:38 +00:00
public bool TrackChecksumsVisible
{
get => _trackChecksumsVisible;
set => this.RaiseAndSetIfChanged(ref _trackChecksumsVisible, value);
}
2022-03-06 13:29:38 +00:00
public bool MediaChecksumsVisible
{
get => _mediaChecksumsVisible;
set => this.RaiseAndSetIfChanged(ref _mediaChecksumsVisible, value);
}
2022-03-06 13:29:38 +00:00
public bool ProgressVisible
{
get => _progressVisible;
set => this.RaiseAndSetIfChanged(ref _progressVisible, value);
}
2022-03-06 13:29:38 +00:00
public bool Progress1Visible
{
get => _progress1Visible;
set => this.RaiseAndSetIfChanged(ref _progress1Visible, value);
}
2022-03-06 13:29:38 +00:00
public string ProgressText
{
get => _progressText;
set => this.RaiseAndSetIfChanged(ref _progressText, value);
}
2022-03-06 13:29:38 +00:00
public double ProgressMax
{
get => _progressMax;
set => this.RaiseAndSetIfChanged(ref _progressMax, value);
}
2022-03-06 13:29:38 +00:00
public double ProgressValue
{
get => _progressValue;
set => this.RaiseAndSetIfChanged(ref _progressValue, value);
}
2022-03-06 13:29:38 +00:00
public bool Progress2Visible
{
get => _progress2Visible;
set => this.RaiseAndSetIfChanged(ref _progress2Visible, value);
}
2022-03-06 13:29:38 +00:00
public string Progress2Text
{
get => _progress2Text;
set => this.RaiseAndSetIfChanged(ref _progress2Text, value);
}
2022-03-06 13:29:38 +00:00
public double Progress2Max
{
get => _progress2Max;
set => this.RaiseAndSetIfChanged(ref _progress2Max, value);
}
2022-03-06 13:29:38 +00:00
public double Progress2Value
{
get => _progress2Value;
set => this.RaiseAndSetIfChanged(ref _progress2Value, value);
}
2022-03-06 13:29:38 +00:00
public bool StartCommandEnabled
{
get => _startCommandEnabled;
set => this.RaiseAndSetIfChanged(ref _startCommandEnabled, value);
}
2022-03-06 13:29:38 +00:00
public bool StartCommandVisible
{
get => _startCommandVisible;
set => this.RaiseAndSetIfChanged(ref _startCommandVisible, value);
}
2022-03-06 13:29:38 +00:00
public bool CloseCommandEnabled
{
get => _closeCommandEnabled;
set => this.RaiseAndSetIfChanged(ref _closeCommandEnabled, value);
}
2022-03-06 13:29:38 +00:00
public bool CloseCommandVisible
{
get => _closeCommandVisible;
set => this.RaiseAndSetIfChanged(ref _closeCommandVisible, value);
}
2022-03-06 13:29:38 +00:00
public bool StopCommandEnabled
{
get => _stopCommandEnabled;
set => this.RaiseAndSetIfChanged(ref _stopCommandEnabled, value);
}
2022-03-06 13:29:38 +00:00
public bool StopCommandVisible
{
get => _stopCommandVisible;
set => this.RaiseAndSetIfChanged(ref _stopCommandVisible, value);
}
2022-03-06 13:29:38 +00:00
public bool ChecksumTracksVisible
{
get => _checksumTracksVisible;
set => this.RaiseAndSetIfChanged(ref _stopCommandVisible, value);
}
2022-03-06 13:29:38 +00:00
public ObservableCollection<ChecksumModel> TrackChecksums { get; }
public ObservableCollection<ChecksumModel> MediaChecksums { get; }
public ReactiveCommand<Unit, Unit> StartCommand { get; }
public ReactiveCommand<Unit, Unit> CloseCommand { get; }
public ReactiveCommand<Unit, Unit> StopCommand { get; }
2022-03-06 13:29:38 +00:00
void ExecuteStartCommand()
{
OptionsEnabled = false;
CloseCommandVisible = false;
StartCommandVisible = false;
StopCommandVisible = true;
ProgressVisible = true;
Progress1Visible = true;
Progress2Visible = false;
new Thread(DoWork)
{
Priority = ThreadPriority.BelowNormal
}.Start();
}
2022-03-06 13:29:38 +00:00
void ExecuteCloseCommand() => _view.Close();
2022-03-06 13:29:38 +00:00
internal void ExecuteStopCommand()
{
_cancel = true;
StopCommandEnabled = false;
}
2022-03-06 13:29:38 +00:00
async void DoWork()
{
2022-03-07 07:36:44 +00:00
var opticalMediaImage = _inputFormat as IOpticalMediaImage;
var formatHasTracks = false;
2022-03-06 13:29:38 +00:00
if(opticalMediaImage != null)
try
{
formatHasTracks = opticalMediaImage.Tracks?.Count > 0;
}
catch
{
formatHasTracks = false;
}
2022-03-06 13:29:38 +00:00
// Setup progress bars
await Dispatcher.UIThread.InvokeAsync(() =>
{
ProgressVisible = true;
Progress1Visible = true;
Progress2Visible = true;
ProgressMax = 1;
Progress2Max = (int)(_inputFormat.Info.Sectors / SECTORS_TO_READ);
2022-03-06 13:29:38 +00:00
if(formatHasTracks &&
ChecksumTracksChecked &&
opticalMediaImage != null)
ProgressMax += opticalMediaImage.Tracks.Count;
else
{
2022-03-06 13:29:38 +00:00
ProgressMax = 2;
Progress2Visible = false;
}
});
2022-03-06 13:29:38 +00:00
var enabledChecksums = new EnableChecksum();
2022-03-06 13:29:38 +00:00
if(Adler32Checked)
enabledChecksums |= EnableChecksum.Adler32;
2022-03-06 13:29:38 +00:00
if(Crc16Checked)
enabledChecksums |= EnableChecksum.Crc16;
2022-03-06 13:29:38 +00:00
if(Crc32Checked)
enabledChecksums |= EnableChecksum.Crc32;
2022-03-06 13:29:38 +00:00
if(Crc64Checked)
enabledChecksums |= EnableChecksum.Crc64;
2022-03-06 13:29:38 +00:00
if(Md5Checked)
enabledChecksums |= EnableChecksum.Md5;
2022-03-06 13:29:38 +00:00
if(Sha1Checked)
enabledChecksums |= EnableChecksum.Sha1;
2022-03-06 13:29:38 +00:00
if(Sha256Checked)
enabledChecksums |= EnableChecksum.Sha256;
2022-03-06 13:29:38 +00:00
if(Sha384Checked)
enabledChecksums |= EnableChecksum.Sha384;
2022-03-06 13:29:38 +00:00
if(Sha512Checked)
enabledChecksums |= EnableChecksum.Sha512;
2022-03-06 13:29:38 +00:00
if(SpamsumChecked)
enabledChecksums |= EnableChecksum.SpamSum;
2022-03-06 13:29:38 +00:00
if(Fletcher16Checked)
enabledChecksums |= EnableChecksum.Fletcher16;
2022-03-06 13:29:38 +00:00
if(Fletcher32Checked)
enabledChecksums |= EnableChecksum.Fletcher32;
2022-03-06 13:29:38 +00:00
Checksum mediaChecksum = null;
ErrorNumber errno;
2022-03-06 13:29:38 +00:00
if(opticalMediaImage?.Tracks != null)
try
{
Checksum trackChecksum = null;
2022-03-06 13:29:38 +00:00
if(ChecksumMediaChecked)
mediaChecksum = new Checksum(enabledChecksums);
2022-03-06 13:29:38 +00:00
ulong previousTrackEnd = 0;
2022-03-06 13:29:38 +00:00
foreach(Track currentTrack in opticalMediaImage.Tracks)
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
2022-03-06 13:29:38 +00:00
ProgressText = $"Hashing track {currentTrack.Sequence} of {opticalMediaImage.Tracks.Count}";
2022-03-06 13:29:38 +00:00
ProgressValue++;
});
2022-03-06 13:29:38 +00:00
if(currentTrack.StartSector - previousTrackEnd != 0 && ChecksumMediaChecked)
for(ulong i = previousTrackEnd + 1; i < currentTrack.StartSector; i++)
{
2022-03-06 13:29:38 +00:00
ulong sector = i;
await Dispatcher.UIThread.InvokeAsync(() =>
{
2022-03-06 13:29:38 +00:00
Progress2Value = (int)(sector / SECTORS_TO_READ);
Progress2Text = $"Hashing track-less sector {sector}";
});
2022-03-06 13:29:38 +00:00
errno = opticalMediaImage.ReadSector(i, out byte[] hiddenSector);
2022-03-06 13:29:38 +00:00
if(errno != ErrorNumber.NoError)
{
2022-03-06 13:29:38 +00:00
AaruConsole.ErrorWriteLine($"Error {errno} reading sector {i}");
_cancel = true;
2022-03-06 13:29:38 +00:00
break;
}
2022-03-06 13:29:38 +00:00
mediaChecksum?.Update(hiddenSector);
}
2022-03-06 13:29:38 +00:00
AaruConsole.DebugWriteLine("Checksum command",
"Track {0} starts at sector {1} and ends at sector {2}",
2022-03-07 07:36:44 +00:00
currentTrack.Sequence, currentTrack.StartSector, currentTrack.EndSector);
2022-03-06 13:29:38 +00:00
if(ChecksumTracksChecked)
trackChecksum = new Checksum(enabledChecksums);
2022-03-06 13:29:38 +00:00
ulong sectors = currentTrack.EndSector - currentTrack.StartSector + 1;
ulong doneSectors = 0;
2022-03-06 13:29:38 +00:00
while(doneSectors < sectors)
{
if(_cancel)
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
2022-03-06 13:29:38 +00:00
CloseCommandVisible = true;
StartCommandVisible = false;
StopCommandVisible = false;
});
2022-03-06 13:29:38 +00:00
return;
}
2022-03-06 13:29:38 +00:00
byte[] sector;
2022-03-06 13:29:38 +00:00
if(sectors - doneSectors >= SECTORS_TO_READ)
{
2022-03-07 07:36:44 +00:00
errno = opticalMediaImage.ReadSectors(doneSectors, SECTORS_TO_READ, currentTrack.Sequence,
out sector);
2022-03-06 13:29:38 +00:00
if(errno != ErrorNumber.NoError)
{
AaruConsole.ErrorWriteLine($"Error {errno} reading sector {doneSectors}");
_cancel = true;
2022-03-06 13:29:38 +00:00
continue;
}
2022-03-06 13:29:38 +00:00
ulong doneSectorsToInvoke = doneSectors;
await Dispatcher.UIThread.InvokeAsync(() =>
{
2022-03-06 13:29:38 +00:00
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
Progress2Text =
$"Hashing sectors {doneSectorsToInvoke} to {doneSectorsToInvoke + SECTORS_TO_READ} of track {currentTrack.Sequence}";
});
2022-03-06 13:29:38 +00:00
doneSectors += SECTORS_TO_READ;
}
else
{
errno = opticalMediaImage.ReadSectors(doneSectors, (uint)(sectors - doneSectors),
currentTrack.Sequence, out sector);
if(errno != ErrorNumber.NoError)
{
2022-03-06 13:29:38 +00:00
AaruConsole.ErrorWriteLine($"Error {errno} reading sector {doneSectors}");
_cancel = true;
2022-03-06 13:29:38 +00:00
continue;
}
2022-03-06 13:29:38 +00:00
ulong doneSectorsToInvoke = doneSectors;
await Dispatcher.UIThread.InvokeAsync(() =>
{
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
Progress2Text =
$"Hashing sectors {doneSectorsToInvoke} to {doneSectorsToInvoke + (sectors - doneSectorsToInvoke)} of track {currentTrack.Sequence}";
});
doneSectors += sectors - doneSectors;
}
2022-03-06 13:29:38 +00:00
if(ChecksumMediaChecked)
mediaChecksum?.Update(sector);
if(ChecksumTracksChecked)
trackChecksum?.Update(sector);
}
await Dispatcher.UIThread.InvokeAsync(() =>
{
2022-03-06 13:29:38 +00:00
if(ChecksumTracksChecked != true)
return;
if(trackChecksum == null)
return;
2022-03-06 13:29:38 +00:00
foreach(ChecksumType chk in trackChecksum.End())
TrackChecksums.Add(new ChecksumModel
{
2022-03-06 13:29:38 +00:00
Track = currentTrack.Sequence.ToString(),
2020-07-20 04:34:16 +01:00
Algorithm = chk.type.ToString(),
Hash = chk.Value
});
});
2022-03-06 13:29:38 +00:00
previousTrackEnd = currentTrack.EndSector;
}
2022-03-06 13:29:38 +00:00
if(opticalMediaImage.Info.Sectors - previousTrackEnd != 0 && ChecksumMediaChecked)
for(ulong i = previousTrackEnd + 1; i < opticalMediaImage.Info.Sectors; i++)
{
2022-03-06 13:29:38 +00:00
ulong sector = i;
await Dispatcher.UIThread.InvokeAsync(() =>
{
2022-03-06 13:29:38 +00:00
Progress2Value = (int)(sector / SECTORS_TO_READ);
Progress2Text = $"Hashing track-less sector {sector}";
});
2022-03-06 13:29:38 +00:00
errno = opticalMediaImage.ReadSector(i, out byte[] hiddenSector);
if(errno != ErrorNumber.NoError)
{
2022-03-06 13:29:38 +00:00
AaruConsole.ErrorWriteLine($"Error {errno} reading sector {i}");
_cancel = true;
2022-03-06 13:29:38 +00:00
break;
}
2022-03-06 13:29:38 +00:00
mediaChecksum?.Update(hiddenSector);
}
await Dispatcher.UIThread.InvokeAsync(() =>
{
2022-03-06 13:29:38 +00:00
if(mediaChecksum == null)
return;
foreach(ChecksumType chk in mediaChecksum.End())
MediaChecksums.Add(new ChecksumModel
{
2020-07-20 04:34:16 +01:00
Algorithm = chk.type.ToString(),
Hash = chk.Value
});
});
}
2022-03-06 13:29:38 +00:00
catch(Exception ex)
{
AaruConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message);
AaruConsole.WriteLine("Unable to get separate tracks, not checksumming them");
}
else
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
Progress1Visible = false;
});
2022-03-06 13:29:38 +00:00
mediaChecksum = new Checksum(enabledChecksums);
ulong doneSectors = 0;
while(doneSectors < _inputFormat.Info.Sectors)
{
if(_cancel)
{
2022-03-06 13:29:38 +00:00
await Dispatcher.UIThread.InvokeAsync(() =>
{
CloseCommandVisible = true;
StartCommandVisible = false;
StopCommandVisible = false;
});
2022-03-06 13:29:38 +00:00
return;
}
byte[] sector;
if(_inputFormat.Info.Sectors - doneSectors >= SECTORS_TO_READ)
{
2022-03-06 13:29:38 +00:00
errno = _inputFormat.ReadSectors(doneSectors, SECTORS_TO_READ, out sector);
if(errno != ErrorNumber.NoError)
{
AaruConsole.ErrorWriteLine($"Error {errno} reading sector {doneSectors}");
_cancel = true;
continue;
}
ulong doneSectorsToInvoke = doneSectors;
await Dispatcher.UIThread.InvokeAsync(() =>
{
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
2022-03-06 13:29:38 +00:00
Progress2Text =
$"Hashing sectors {doneSectorsToInvoke} to {doneSectorsToInvoke + SECTORS_TO_READ}";
});
doneSectors += SECTORS_TO_READ;
}
else
{
errno = _inputFormat.ReadSectors(doneSectors, (uint)(_inputFormat.Info.Sectors - doneSectors),
out sector);
if(errno != ErrorNumber.NoError)
{
AaruConsole.ErrorWriteLine($"Error {errno} reading sector {doneSectors}");
_cancel = true;
continue;
}
ulong doneSectorsToInvoke = doneSectors;
await Dispatcher.UIThread.InvokeAsync(() =>
{
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
Progress2Text =
$"Hashing sectors {doneSectorsToInvoke} to {doneSectorsToInvoke + (_inputFormat.Info.Sectors - doneSectorsToInvoke)}";
});
doneSectors += _inputFormat.Info.Sectors - doneSectors;
}
mediaChecksum.Update(sector);
}
await Dispatcher.UIThread.InvokeAsync(() =>
{
2022-03-06 13:29:38 +00:00
foreach(ChecksumType chk in mediaChecksum.End())
MediaChecksums.Add(new ChecksumModel
{
Algorithm = chk.type.ToString(),
Hash = chk.Value
});
});
}
2022-03-06 13:29:38 +00:00
if(ChecksumTracksChecked)
await Dispatcher.UIThread.InvokeAsync(() =>
{
TrackChecksumsVisible = true;
});
if(ChecksumMediaChecked)
await Dispatcher.UIThread.InvokeAsync(() =>
{
MediaChecksumsVisible = true;
});
Statistics.AddCommand("checksum");
await Dispatcher.UIThread.InvokeAsync(() =>
{
OptionsEnabled = false;
ResultsVisible = true;
ProgressVisible = false;
StartCommandVisible = false;
StopCommandVisible = false;
CloseCommandVisible = true;
});
}
}