mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General refactor and cleanup.
This commit is contained in:
@@ -75,8 +75,7 @@ public sealed class AboutViewModel : ViewModelBase
|
||||
(Attribute.GetCustomAttribute(assembly, typeof(AssemblyInformationalVersionAttribute)) as
|
||||
AssemblyInformationalVersionAttribute)?.InformationalVersion;
|
||||
|
||||
if(name is null || version is null)
|
||||
continue;
|
||||
if(name is null || version is null) continue;
|
||||
|
||||
Assemblies.Add(new AssemblyModel
|
||||
{
|
||||
|
||||
@@ -108,8 +108,7 @@ public sealed class ConsoleViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSave.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -128,7 +127,9 @@ public sealed class ConsoleViewModel : ViewModelBase
|
||||
|
||||
logSw.WriteLine(Localization.Core.System_information);
|
||||
|
||||
logSw.WriteLine("{0} {1} ({2}-bit)", DetectOS.GetPlatformName(platId, platVer), platVer,
|
||||
logSw.WriteLine("{0} {1} ({2}-bit)",
|
||||
DetectOS.GetPlatformName(platId, platVer),
|
||||
platVer,
|
||||
Environment.Is64BitOperatingSystem ? 64 : 32);
|
||||
|
||||
logSw.WriteLine(".NET Core {0}", Version.GetNetCoreVersion());
|
||||
@@ -138,9 +139,9 @@ public sealed class ConsoleViewModel : ViewModelBase
|
||||
logSw.WriteLine(Localization.Core.Program_information);
|
||||
logSw.WriteLine("Aaru {0}", assemblyVersion?.InformationalVersion);
|
||||
logSw.WriteLine(Localization.Core.Running_in_0_bit, Environment.Is64BitProcess ? 64 : 32);
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
logSw.WriteLine(Localization.Core.DEBUG_version);
|
||||
#endif
|
||||
#endif
|
||||
logSw.WriteLine(Localization.Core.Command_line_0, Environment.CommandLine);
|
||||
logSw.WriteLine();
|
||||
|
||||
@@ -160,10 +161,13 @@ public sealed class ConsoleViewModel : ViewModelBase
|
||||
catch(Exception exception)
|
||||
{
|
||||
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||
string.
|
||||
Format(UI.Exception_0_trying_to_save_logfile_details_has_been_sent_to_console,
|
||||
exception.Message), ButtonEnum.Ok, Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
string
|
||||
.Format(UI
|
||||
.Exception_0_trying_to_save_logfile_details_has_been_sent_to_console,
|
||||
exception.Message),
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
AaruConsole.WriteException(exception);
|
||||
}
|
||||
|
||||
@@ -55,23 +55,22 @@ public sealed class EncodingsViewModel : ViewModelBase
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
var encodings = Encoding.GetEncodings().
|
||||
Select(info => new EncodingModel
|
||||
var encodings = Encoding.GetEncodings()
|
||||
.Select(info => new EncodingModel
|
||||
{
|
||||
Name = info.Name,
|
||||
DisplayName = info.GetEncoding().EncodingName
|
||||
}).
|
||||
ToList();
|
||||
})
|
||||
.ToList();
|
||||
|
||||
encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings().
|
||||
Select(info => new EncodingModel
|
||||
encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings()
|
||||
.Select(info => new EncodingModel
|
||||
{
|
||||
Name = info.Name,
|
||||
DisplayName = info.DisplayName
|
||||
}));
|
||||
|
||||
foreach(EncodingModel encoding in encodings.OrderBy(t => t.DisplayName))
|
||||
Encodings.Add(encoding);
|
||||
foreach(EncodingModel encoding in encodings.OrderBy(t => t.DisplayName)) Encodings.Add(encoding);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -53,8 +53,7 @@ public sealed class LicenseViewModel : ViewModelBase
|
||||
// TODO: Localize
|
||||
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Aaru.Gui.LICENSE");
|
||||
|
||||
if(stream == null)
|
||||
return;
|
||||
if(stream == null) return;
|
||||
|
||||
using var reader = new StreamReader(stream);
|
||||
|
||||
|
||||
@@ -63,8 +63,7 @@ public sealed class PluginsViewModel : ViewModelBase
|
||||
// TODO: Takes too much time
|
||||
foreach(IFilter filter in PluginRegister.Singleton.Filters.Values)
|
||||
{
|
||||
if(filter is null)
|
||||
continue;
|
||||
if(filter is null) continue;
|
||||
|
||||
Filters.Add(new PluginModel
|
||||
{
|
||||
@@ -77,8 +76,7 @@ public sealed class PluginsViewModel : ViewModelBase
|
||||
|
||||
foreach(IFloppyImage floppyImage in PluginRegister.Singleton.FloppyImages.Values)
|
||||
{
|
||||
if(floppyImage is null)
|
||||
continue;
|
||||
if(floppyImage is null) continue;
|
||||
|
||||
FloppyImages.Add(new PluginModel
|
||||
{
|
||||
@@ -91,8 +89,7 @@ public sealed class PluginsViewModel : ViewModelBase
|
||||
|
||||
foreach(IMediaImage mediaImage in PluginRegister.Singleton.MediaImages.Values)
|
||||
{
|
||||
if(mediaImage is null)
|
||||
continue;
|
||||
if(mediaImage is null) continue;
|
||||
|
||||
Images.Add(new PluginModel
|
||||
{
|
||||
@@ -105,8 +102,7 @@ public sealed class PluginsViewModel : ViewModelBase
|
||||
|
||||
foreach(IPartition partition in PluginRegister.Singleton.Partitions.Values)
|
||||
{
|
||||
if(partition is null)
|
||||
continue;
|
||||
if(partition is null) continue;
|
||||
|
||||
PartitionSchemes.Add(new PluginModel
|
||||
{
|
||||
@@ -119,8 +115,7 @@ public sealed class PluginsViewModel : ViewModelBase
|
||||
|
||||
foreach(IFilesystem filesystem in PluginRegister.Singleton.Filesystems.Values)
|
||||
{
|
||||
if(filesystem is null)
|
||||
continue;
|
||||
if(filesystem is null) continue;
|
||||
|
||||
Filesystems.Add(new PluginModel
|
||||
{
|
||||
@@ -133,8 +128,7 @@ public sealed class PluginsViewModel : ViewModelBase
|
||||
|
||||
foreach(IReadOnlyFilesystem fs in PluginRegister.Singleton.ReadOnlyFilesystems.Values)
|
||||
{
|
||||
if(fs is null)
|
||||
continue;
|
||||
if(fs is null) continue;
|
||||
|
||||
ReadOnlyFilesystems.Add(new PluginModel
|
||||
{
|
||||
@@ -147,8 +141,7 @@ public sealed class PluginsViewModel : ViewModelBase
|
||||
|
||||
foreach(IWritableFloppyImage writableFloppyImage in PluginRegister.Singleton.WritableFloppyImages.Values)
|
||||
{
|
||||
if(writableFloppyImage is null)
|
||||
continue;
|
||||
if(writableFloppyImage is null) continue;
|
||||
|
||||
WritableFloppyImages.Add(new PluginModel
|
||||
{
|
||||
@@ -161,8 +154,7 @@ public sealed class PluginsViewModel : ViewModelBase
|
||||
|
||||
foreach(IBaseWritableImage writableImage in PluginRegister.Singleton.WritableImages.Values)
|
||||
{
|
||||
if(writableImage is null)
|
||||
continue;
|
||||
if(writableImage is null) continue;
|
||||
|
||||
WritableImages.Add(new PluginModel
|
||||
{
|
||||
|
||||
@@ -85,8 +85,7 @@ public sealed class SettingsViewModel : ViewModelBase
|
||||
CancelCommand = ReactiveCommand.Create(ExecuteCancelCommand);
|
||||
SaveCommand = ReactiveCommand.Create(ExecuteSaveCommand);
|
||||
|
||||
if(!_gdprVisible)
|
||||
_tabControlSelectedIndex = 1;
|
||||
if(!_gdprVisible) _tabControlSelectedIndex = 1;
|
||||
}
|
||||
|
||||
// TODO: Show Preferences in macOS
|
||||
|
||||
@@ -132,9 +132,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "fs-info"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "fs-info" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "fs-info" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "fs-info" && !c.Synchronized);
|
||||
|
||||
@@ -144,9 +144,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "checksum"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "checksum" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "checksum" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "checksum" && !c.Synchronized);
|
||||
|
||||
@@ -156,9 +156,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "compare"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "compare" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "compare" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "compare" && !c.Synchronized);
|
||||
|
||||
@@ -168,9 +168,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "convert-image"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "convert-image" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "convert-image" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "convert-image" && !c.Synchronized);
|
||||
|
||||
@@ -180,9 +180,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "create-sidecar"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "create-sidecar" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "create-sidecar" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "create-sidecar" && !c.Synchronized);
|
||||
|
||||
@@ -192,9 +192,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "decode"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "decode" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "decode" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "decode" && !c.Synchronized);
|
||||
|
||||
@@ -204,9 +204,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "device-info"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "device-info" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "device-info" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "device-info" && !c.Synchronized);
|
||||
|
||||
@@ -216,9 +216,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "device-report"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "device-report" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "device-report" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "device-report" && !c.Synchronized);
|
||||
|
||||
@@ -228,9 +228,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "dump-media"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "dump-media" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "dump-media" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "dump-media" && !c.Synchronized);
|
||||
|
||||
@@ -240,9 +240,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "entropy"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "entropy" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "entropy" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "entropy" && !c.Synchronized);
|
||||
|
||||
@@ -252,9 +252,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "formats"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "formats" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "formats" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "formats" && !c.Synchronized);
|
||||
|
||||
@@ -264,9 +264,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "image-info"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "image-info" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "image-info" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "image-info" && !c.Synchronized);
|
||||
|
||||
@@ -276,9 +276,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "media-info"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "media-info" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "media-info" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "media-info" && !c.Synchronized);
|
||||
|
||||
@@ -288,9 +288,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "media-scan"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "media-scan" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "media-scan" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "media-scan" && !c.Synchronized);
|
||||
|
||||
@@ -300,9 +300,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "printhex"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "printhex" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "printhex" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "printhex" && !c.Synchronized);
|
||||
|
||||
@@ -312,9 +312,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
if(ctx.Commands.Any(c => c.Name == "verify"))
|
||||
{
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "verify" && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Commands.Where(c => c.Name == "verify" && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Commands.LongCount(c => c.Name == "verify" && !c.Synchronized);
|
||||
|
||||
@@ -346,9 +346,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
foreach(string nvs in ctx.Filters.Select(n => n.Name).Distinct())
|
||||
{
|
||||
ulong count = ctx.Filters.Where(c => c.Name == nvs && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Filters.Where(c => c.Name == nvs && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Filters.LongCount(c => c.Name == nvs && !c.Synchronized);
|
||||
|
||||
@@ -366,9 +366,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
foreach(string nvs in ctx.MediaFormats.Select(n => n.Name).Distinct())
|
||||
{
|
||||
ulong count = ctx.MediaFormats.Where(c => c.Name == nvs && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.MediaFormats.Where(c => c.Name == nvs && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.MediaFormats.LongCount(c => c.Name == nvs && !c.Synchronized);
|
||||
|
||||
@@ -386,9 +386,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
foreach(string nvs in ctx.Partitions.Select(n => n.Name).Distinct())
|
||||
{
|
||||
ulong count = ctx.Partitions.Where(c => c.Name == nvs && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Partitions.Where(c => c.Name == nvs && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Partitions.LongCount(c => c.Name == nvs && !c.Synchronized);
|
||||
|
||||
@@ -406,9 +406,9 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
|
||||
foreach(string nvs in ctx.Filesystems.Select(n => n.Name).Distinct())
|
||||
{
|
||||
ulong count = ctx.Filesystems.Where(c => c.Name == nvs && c.Synchronized).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Filesystems.Where(c => c.Name == nvs && c.Synchronized)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Filesystems.LongCount(c => c.Name == nvs && !c.Synchronized);
|
||||
|
||||
@@ -424,10 +424,10 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
{
|
||||
DevicesVisible = true;
|
||||
|
||||
foreach(DeviceStat ds in ctx.SeenDevices.OrderBy(n => n.Manufacturer).
|
||||
ThenBy(n => n.Manufacturer).
|
||||
ThenBy(n => n.Revision).
|
||||
ThenBy(n => n.Bus))
|
||||
foreach(DeviceStat ds in ctx.SeenDevices.OrderBy(n => n.Manufacturer)
|
||||
.ThenBy(n => n.Manufacturer)
|
||||
.ThenBy(n => n.Revision)
|
||||
.ThenBy(n => n.Bus))
|
||||
{
|
||||
Devices.Add(new DeviceStatsModel
|
||||
{
|
||||
@@ -439,16 +439,15 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
if(!ctx.Medias.Any())
|
||||
return;
|
||||
if(!ctx.Medias.Any()) return;
|
||||
|
||||
MediasVisible = true;
|
||||
|
||||
foreach(string media in ctx.Medias.OrderBy(ms => ms.Type).Select(ms => ms.Type).Distinct())
|
||||
{
|
||||
ulong count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && c.Real).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
ulong count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && c.Real)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Medias.LongCount(c => c.Type == media && !c.Synchronized && c.Real);
|
||||
|
||||
@@ -462,14 +461,13 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
});
|
||||
}
|
||||
|
||||
count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && !c.Real).
|
||||
Select(c => c.Count).
|
||||
FirstOrDefault();
|
||||
count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && !c.Real)
|
||||
.Select(c => c.Count)
|
||||
.FirstOrDefault();
|
||||
|
||||
count += (ulong)ctx.Medias.LongCount(c => c.Type == media && !c.Synchronized && !c.Real);
|
||||
|
||||
if(count == 0)
|
||||
continue;
|
||||
if(count == 0) continue;
|
||||
|
||||
Medias.Add(new MediaStatsModel
|
||||
{
|
||||
|
||||
@@ -199,9 +199,15 @@ public sealed class DeviceInfoViewModel : ViewModelBase
|
||||
{
|
||||
ScsiInfo = new ScsiInfo
|
||||
{
|
||||
DataContext = new ScsiInfoViewModel(devInfo.ScsiInquiryData, devInfo.ScsiInquiry, devInfo.ScsiEvpdPages,
|
||||
devInfo.ScsiMode, devInfo.ScsiType, devInfo.ScsiModeSense6,
|
||||
devInfo.ScsiModeSense10, devInfo.MmcConfiguration, _view)
|
||||
DataContext = new ScsiInfoViewModel(devInfo.ScsiInquiryData,
|
||||
devInfo.ScsiInquiry,
|
||||
devInfo.ScsiEvpdPages,
|
||||
devInfo.ScsiMode,
|
||||
devInfo.ScsiType,
|
||||
devInfo.ScsiModeSense6,
|
||||
devInfo.ScsiModeSense10,
|
||||
devInfo.MmcConfiguration,
|
||||
_view)
|
||||
};
|
||||
|
||||
if(devInfo.PlextorFeatures != null)
|
||||
@@ -221,11 +227,11 @@ public sealed class DeviceInfoViewModel : ViewModelBase
|
||||
{
|
||||
PlextorDvdTimesVisible = true;
|
||||
|
||||
PlextorDvdReadTime = devInfo.PlextorFeatures.DvdReadTime.Seconds().
|
||||
Humanize(minUnit: TimeUnit.Second);
|
||||
PlextorDvdReadTime = devInfo.PlextorFeatures.DvdReadTime.Seconds()
|
||||
.Humanize(minUnit: TimeUnit.Second);
|
||||
|
||||
PlextorDvdWriteTime = devInfo.PlextorFeatures.DvdWriteTime.Seconds().
|
||||
Humanize(minUnit: TimeUnit.Second);
|
||||
PlextorDvdWriteTime = devInfo.PlextorFeatures.DvdWriteTime.Seconds()
|
||||
.Humanize(minUnit: TimeUnit.Second);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,8 +313,7 @@ public sealed class DeviceInfoViewModel : ViewModelBase
|
||||
PlextorSecuRec = devInfo.PlextorFeatures.SecuRec;
|
||||
PlextorSpeedRead = devInfo.PlextorFeatures.SpeedRead;
|
||||
|
||||
if(devInfo.PlextorFeatures.SpeedRead)
|
||||
PlextorSpeedEnabled = devInfo.PlextorFeatures.SpeedReadEnabled;
|
||||
if(devInfo.PlextorFeatures.SpeedRead) PlextorSpeedEnabled = devInfo.PlextorFeatures.SpeedReadEnabled;
|
||||
|
||||
PlextorHiding = devInfo.PlextorFeatures.Hiding;
|
||||
|
||||
@@ -397,8 +402,12 @@ public sealed class DeviceInfoViewModel : ViewModelBase
|
||||
|
||||
SdMmcInfo = new SdMmcInfo
|
||||
{
|
||||
DataContext = new SdMmcInfoViewModel(devInfo.Type, devInfo.CID, devInfo.CSD, devInfo.OCR,
|
||||
devInfo.ExtendedCSD, devInfo.SCR)
|
||||
DataContext = new SdMmcInfoViewModel(devInfo.Type,
|
||||
devInfo.CID,
|
||||
devInfo.CSD,
|
||||
devInfo.OCR,
|
||||
devInfo.ExtendedCSD,
|
||||
devInfo.SCR)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1023,8 +1032,7 @@ public sealed class DeviceInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_devInfo.UsbDescriptors, 0, _devInfo.UsbDescriptors.Length);
|
||||
|
||||
@@ -77,8 +77,10 @@ public sealed class FileSystemViewModel([NotNull] FileSystem metadata, string in
|
||||
string.Format(Localization.Core.Volume_last_backed_up_on_0, metadata.BackupDate);
|
||||
|
||||
public string ClustersText { get; } =
|
||||
string.Format(Localization.Core.Volume_has_0_clusters_of_1_bytes_each_total_of_2_bytes, metadata.Clusters,
|
||||
metadata.ClusterSize, metadata.Clusters * metadata.ClusterSize);
|
||||
string.Format(Localization.Core.Volume_has_0_clusters_of_1_bytes_each_total_of_2_bytes,
|
||||
metadata.Clusters,
|
||||
metadata.ClusterSize,
|
||||
metadata.Clusters * metadata.ClusterSize);
|
||||
|
||||
public string FreeClustersText { get; } = string.Format(Localization.Core.Volume_has_0_clusters_free_1,
|
||||
metadata.FreeClusters,
|
||||
|
||||
@@ -107,13 +107,10 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
|
||||
MediaLogo = AssetLoader.Exists(mediaResource)
|
||||
? new Bitmap(AssetLoader.Open(mediaResource))
|
||||
:
|
||||
imageFormat.Info.MetadataMediaType == MetadataMediaType.BlockMedia
|
||||
: imageFormat.Info.MetadataMediaType == MetadataMediaType.BlockMedia
|
||||
? genericHddIcon
|
||||
:
|
||||
imageFormat.Info.MetadataMediaType == MetadataMediaType.OpticalDisc
|
||||
?
|
||||
genericOpticalIcon
|
||||
: imageFormat.Info.MetadataMediaType == MetadataMediaType.OpticalDisc
|
||||
? genericOpticalIcon
|
||||
: genericFolderIcon;
|
||||
|
||||
ImagePathText = string.Format(UI.Path_0, imagePath);
|
||||
@@ -129,11 +126,13 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
|
||||
SectorsText =
|
||||
string.Format(Localization.Core.Contains_a_media_of_0_sectors_with_a_maximum_sector_size_of_1_bytes_etc,
|
||||
imageFormat.Info.Sectors, imageFormat.Info.SectorSize,
|
||||
imageFormat.Info.Sectors,
|
||||
imageFormat.Info.SectorSize,
|
||||
ByteSize.FromBytes(imageFormat.Info.Sectors * imageFormat.Info.SectorSize).Humanize());
|
||||
|
||||
MediaTypeText = string.Format(Localization.Core.Contains_a_media_of_type_0_and_XML_type_1,
|
||||
imageFormat.Info.MediaType, imageFormat.Info.MetadataMediaType);
|
||||
imageFormat.Info.MediaType,
|
||||
imageFormat.Info.MetadataMediaType);
|
||||
|
||||
HasPartitionsText = imageFormat.Info.HasPartitions ? UI.Has_partitions : UI.Doesnt_have_partitions;
|
||||
HasSessionsText = imageFormat.Info.HasSessions ? UI.Has_sessions : UI.Doesnt_have_sessions;
|
||||
@@ -142,7 +141,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
{
|
||||
ApplicationText = !string.IsNullOrWhiteSpace(imageFormat.Info.ApplicationVersion)
|
||||
? string.Format(Localization.Core.Was_created_with_0_version_1,
|
||||
imageFormat.Info.Application, imageFormat.Info.ApplicationVersion)
|
||||
imageFormat.Info.Application,
|
||||
imageFormat.Info.ApplicationVersion)
|
||||
: string.Format(Localization.Core.Was_created_with_0, imageFormat.Info.Application);
|
||||
}
|
||||
|
||||
@@ -161,7 +161,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
if(imageFormat.Info.MediaSequence != 0 && imageFormat.Info.LastMediaSequence != 0)
|
||||
{
|
||||
MediaSequenceText = string.Format(Localization.Core.Media_is_number_0_on_a_set_of_1_medias,
|
||||
imageFormat.Info.MediaSequence, imageFormat.Info.LastMediaSequence);
|
||||
imageFormat.Info.MediaSequence,
|
||||
imageFormat.Info.LastMediaSequence);
|
||||
}
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaTitle))
|
||||
@@ -209,7 +210,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
imageFormat is not ITapeImage { IsTape: true })
|
||||
{
|
||||
MediaGeometryText = string.Format(UI.Media_geometry_0_cylinders_1_heads_2_sectors_per_track,
|
||||
imageFormat.Info.Cylinders, imageFormat.Info.Heads,
|
||||
imageFormat.Info.Cylinders,
|
||||
imageFormat.Info.Heads,
|
||||
imageFormat.Info.SectorsPerTrack);
|
||||
}
|
||||
|
||||
@@ -249,22 +251,27 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
{
|
||||
errno = imageFormat.ReadMediaTag(MediaTagType.SCSI_MODESENSE_6, out scsiModeSense6);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
scsiMode = Modes.DecodeMode6(scsiModeSense6, scsiDeviceType);
|
||||
if(errno == ErrorNumber.NoError) scsiMode = Modes.DecodeMode6(scsiModeSense6, scsiDeviceType);
|
||||
}
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.SCSI_MODESENSE_10) == true)
|
||||
{
|
||||
errno = imageFormat.ReadMediaTag(MediaTagType.SCSI_MODESENSE_10, out scsiModeSense10);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
scsiMode = Modes.DecodeMode10(scsiModeSense10, scsiDeviceType);
|
||||
if(errno == ErrorNumber.NoError) scsiMode = Modes.DecodeMode10(scsiModeSense10, scsiDeviceType);
|
||||
}
|
||||
|
||||
ScsiInfo = new ScsiInfo
|
||||
{
|
||||
DataContext = new ScsiInfoViewModel(scsiInquiryData, scsiInquiry, null, scsiMode, scsiDeviceType,
|
||||
scsiModeSense6, scsiModeSense10, null, view)
|
||||
DataContext = new ScsiInfoViewModel(scsiInquiryData,
|
||||
scsiInquiry,
|
||||
null,
|
||||
scsiMode,
|
||||
scsiDeviceType,
|
||||
scsiModeSense6,
|
||||
scsiModeSense10,
|
||||
null,
|
||||
view)
|
||||
};
|
||||
|
||||
byte[] ataIdentify = null;
|
||||
@@ -407,15 +414,27 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
{
|
||||
errno = imageFormat.ReadMediaTag(MediaTagType.CD_MCN, out byte[] mcn);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
mediaCatalogueNumber = Encoding.UTF8.GetString(mcn);
|
||||
if(errno == ErrorNumber.NoError) mediaCatalogueNumber = Encoding.UTF8.GetString(mcn);
|
||||
}
|
||||
|
||||
CompactDiscInfo = new CompactDiscInfo
|
||||
{
|
||||
DataContext = new CompactDiscInfoViewModel(toc, atip, null, null, fullToc, pma, cdtext, decodedToc,
|
||||
decodedAtip, null, decodedFullToc, decodedCdText, null,
|
||||
mediaCatalogueNumber, null, view)
|
||||
DataContext = new CompactDiscInfoViewModel(toc,
|
||||
atip,
|
||||
null,
|
||||
null,
|
||||
fullToc,
|
||||
pma,
|
||||
cdtext,
|
||||
decodedToc,
|
||||
decodedAtip,
|
||||
null,
|
||||
decodedFullToc,
|
||||
decodedCdText,
|
||||
null,
|
||||
mediaCatalogueNumber,
|
||||
null,
|
||||
view)
|
||||
};
|
||||
|
||||
byte[] dvdPfi = null;
|
||||
@@ -429,8 +448,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
{
|
||||
errno = imageFormat.ReadMediaTag(MediaTagType.DVD_PFI, out dvdPfi);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
decodedPfi = PFI.Decode(dvdPfi, imageFormat.Info.MediaType);
|
||||
if(errno == ErrorNumber.NoError) decodedPfi = PFI.Decode(dvdPfi, imageFormat.Info.MediaType);
|
||||
}
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVD_DMI) == true)
|
||||
@@ -447,8 +465,14 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
|
||||
DvdInfo = new DvdInfo
|
||||
{
|
||||
DataContext = new DvdInfoViewModel(dvdPfi, dvdDmi, dvdCmi, hddvdCopyrightInformation, dvdBca, null,
|
||||
decodedPfi, view)
|
||||
DataContext = new DvdInfoViewModel(dvdPfi,
|
||||
dvdDmi,
|
||||
dvdCmi,
|
||||
hddvdCopyrightInformation,
|
||||
dvdBca,
|
||||
null,
|
||||
decodedPfi,
|
||||
view)
|
||||
};
|
||||
|
||||
byte[] dvdRamDds = null;
|
||||
@@ -510,11 +534,22 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
|
||||
DvdWritableInfo = new DvdWritableInfo
|
||||
{
|
||||
DataContext = new DvdWritableInfoViewModel(dvdRamDds, dvdRamCartridgeStatus, dvdRamSpareArea,
|
||||
lastBorderOutRmd, dvdPreRecordedInfo, dvdrMediaIdentifier,
|
||||
dvdrPhysicalInformation, hddvdrMediumStatus, null,
|
||||
dvdrLayerCapacity, dvdrDlMiddleZoneStart, dvdrDlJumpIntervalSize,
|
||||
dvdrDlManualLayerJumpStartLba, null, dvdPlusAdip, dvdPlusDcb,
|
||||
DataContext = new DvdWritableInfoViewModel(dvdRamDds,
|
||||
dvdRamCartridgeStatus,
|
||||
dvdRamSpareArea,
|
||||
lastBorderOutRmd,
|
||||
dvdPreRecordedInfo,
|
||||
dvdrMediaIdentifier,
|
||||
dvdrPhysicalInformation,
|
||||
hddvdrMediumStatus,
|
||||
null,
|
||||
dvdrLayerCapacity,
|
||||
dvdrDlMiddleZoneStart,
|
||||
dvdrDlJumpIntervalSize,
|
||||
dvdrDlManualLayerJumpStartLba,
|
||||
null,
|
||||
dvdPlusAdip,
|
||||
dvdPlusDcb,
|
||||
view)
|
||||
};
|
||||
|
||||
@@ -549,9 +584,16 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
|
||||
BlurayInfo = new BlurayInfo
|
||||
{
|
||||
DataContext = new BlurayInfoViewModel(blurayDiscInformation, blurayBurstCuttingArea, blurayDds,
|
||||
blurayCartridgeStatus, bluraySpareAreaInformation, blurayPowResources,
|
||||
blurayTrackResources, null, null, view)
|
||||
DataContext = new BlurayInfoViewModel(blurayDiscInformation,
|
||||
blurayBurstCuttingArea,
|
||||
blurayDds,
|
||||
blurayCartridgeStatus,
|
||||
bluraySpareAreaInformation,
|
||||
blurayPowResources,
|
||||
blurayTrackResources,
|
||||
null,
|
||||
null,
|
||||
view)
|
||||
};
|
||||
|
||||
byte[] xboxDmi = null;
|
||||
@@ -565,8 +607,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
{
|
||||
errno = imageFormat.ReadMediaTag(MediaTagType.Xbox_SecuritySector, out xboxSecuritySector);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
decodedXboxSecuritySector = SS.Decode(xboxSecuritySector);
|
||||
if(errno == ErrorNumber.NoError) decodedXboxSecuritySector = SS.Decode(xboxSecuritySector);
|
||||
}
|
||||
|
||||
XboxInfo = new XboxInfo
|
||||
@@ -654,8 +695,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
{
|
||||
if(opticalMediaImage.Sessions is { Count: > 0 })
|
||||
{
|
||||
foreach(Session session in opticalMediaImage.Sessions)
|
||||
Sessions.Add(session);
|
||||
foreach(Session session in opticalMediaImage.Sessions) Sessions.Add(session);
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -667,8 +707,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
{
|
||||
if(opticalMediaImage.Tracks is { Count: > 0 })
|
||||
{
|
||||
foreach(Track track in opticalMediaImage.Tracks)
|
||||
Tracks.Add(track);
|
||||
foreach(Track track in opticalMediaImage.Tracks) Tracks.Add(track);
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -677,8 +716,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
if(imageFormat.DumpHardware is null)
|
||||
return;
|
||||
if(imageFormat.DumpHardware is null) return;
|
||||
|
||||
foreach(DumpHardware dump in imageFormat.DumpHardware)
|
||||
{
|
||||
|
||||
@@ -105,7 +105,8 @@ public sealed class MediaInfoViewModel : ViewModelBase
|
||||
if(scsiInfo.Blocks != 0 && scsiInfo.BlockSize != 0)
|
||||
{
|
||||
MediaSize = string.Format(Localization.Core.Media_has_0_blocks_of_1_bytes_each_for_a_total_of_2,
|
||||
scsiInfo.Blocks, scsiInfo.BlockSize,
|
||||
scsiInfo.Blocks,
|
||||
scsiInfo.BlockSize,
|
||||
ByteSize.FromBytes(scsiInfo.Blocks * scsiInfo.BlockSize).ToString("0.000"));
|
||||
}
|
||||
|
||||
@@ -144,47 +145,78 @@ public sealed class MediaInfoViewModel : ViewModelBase
|
||||
|
||||
CompactDiscInfo = new CompactDiscInfo
|
||||
{
|
||||
DataContext = new CompactDiscInfoViewModel(scsiInfo.Toc, scsiInfo.Atip, scsiInfo.DiscInformation,
|
||||
scsiInfo.Session, scsiInfo.RawToc, scsiInfo.Pma,
|
||||
scsiInfo.CdTextLeadIn, scsiInfo.DecodedToc, scsiInfo.DecodedAtip,
|
||||
scsiInfo.DecodedSession, scsiInfo.FullToc,
|
||||
scsiInfo.DecodedCdTextLeadIn, scsiInfo.DecodedDiscInformation,
|
||||
scsiInfo.Mcn, scsiInfo.Isrcs, _view)
|
||||
DataContext = new CompactDiscInfoViewModel(scsiInfo.Toc,
|
||||
scsiInfo.Atip,
|
||||
scsiInfo.DiscInformation,
|
||||
scsiInfo.Session,
|
||||
scsiInfo.RawToc,
|
||||
scsiInfo.Pma,
|
||||
scsiInfo.CdTextLeadIn,
|
||||
scsiInfo.DecodedToc,
|
||||
scsiInfo.DecodedAtip,
|
||||
scsiInfo.DecodedSession,
|
||||
scsiInfo.FullToc,
|
||||
scsiInfo.DecodedCdTextLeadIn,
|
||||
scsiInfo.DecodedDiscInformation,
|
||||
scsiInfo.Mcn,
|
||||
scsiInfo.Isrcs,
|
||||
_view)
|
||||
};
|
||||
|
||||
DvdInfo = new DvdInfo
|
||||
{
|
||||
DataContext = new DvdInfoViewModel(scsiInfo.DvdPfi, scsiInfo.DvdDmi, scsiInfo.DvdCmi,
|
||||
scsiInfo.HddvdCopyrightInformation, scsiInfo.DvdBca, scsiInfo.DvdAacs,
|
||||
scsiInfo.DecodedPfi, _view)
|
||||
DataContext = new DvdInfoViewModel(scsiInfo.DvdPfi,
|
||||
scsiInfo.DvdDmi,
|
||||
scsiInfo.DvdCmi,
|
||||
scsiInfo.HddvdCopyrightInformation,
|
||||
scsiInfo.DvdBca,
|
||||
scsiInfo.DvdAacs,
|
||||
scsiInfo.DecodedPfi,
|
||||
_view)
|
||||
};
|
||||
|
||||
XboxInfo = new XboxInfo
|
||||
{
|
||||
DataContext = new XboxInfoViewModel(scsiInfo.XgdInfo, scsiInfo.DvdDmi, scsiInfo.XboxSecuritySector,
|
||||
scsiInfo.DecodedXboxSecuritySector, _view)
|
||||
DataContext = new XboxInfoViewModel(scsiInfo.XgdInfo,
|
||||
scsiInfo.DvdDmi,
|
||||
scsiInfo.XboxSecuritySector,
|
||||
scsiInfo.DecodedXboxSecuritySector,
|
||||
_view)
|
||||
};
|
||||
|
||||
DvdWritableInfo = new DvdWritableInfo
|
||||
{
|
||||
DataContext = new DvdWritableInfoViewModel(scsiInfo.DvdRamDds, scsiInfo.DvdRamCartridgeStatus,
|
||||
scsiInfo.DvdRamSpareArea, scsiInfo.LastBorderOutRmd,
|
||||
scsiInfo.DvdPreRecordedInfo, scsiInfo.DvdrMediaIdentifier,
|
||||
scsiInfo.DvdrPhysicalInformation, scsiInfo.HddvdrMediumStatus,
|
||||
scsiInfo.HddvdrLastRmd, scsiInfo.DvdrLayerCapacity,
|
||||
scsiInfo.DvdrDlMiddleZoneStart, scsiInfo.DvdrDlJumpIntervalSize,
|
||||
DataContext = new DvdWritableInfoViewModel(scsiInfo.DvdRamDds,
|
||||
scsiInfo.DvdRamCartridgeStatus,
|
||||
scsiInfo.DvdRamSpareArea,
|
||||
scsiInfo.LastBorderOutRmd,
|
||||
scsiInfo.DvdPreRecordedInfo,
|
||||
scsiInfo.DvdrMediaIdentifier,
|
||||
scsiInfo.DvdrPhysicalInformation,
|
||||
scsiInfo.HddvdrMediumStatus,
|
||||
scsiInfo.HddvdrLastRmd,
|
||||
scsiInfo.DvdrLayerCapacity,
|
||||
scsiInfo.DvdrDlMiddleZoneStart,
|
||||
scsiInfo.DvdrDlJumpIntervalSize,
|
||||
scsiInfo.DvdrDlManualLayerJumpStartLba,
|
||||
scsiInfo.DvdrDlRemapAnchorPoint, scsiInfo.DvdPlusAdip,
|
||||
scsiInfo.DvdPlusDcb, _view)
|
||||
scsiInfo.DvdrDlRemapAnchorPoint,
|
||||
scsiInfo.DvdPlusAdip,
|
||||
scsiInfo.DvdPlusDcb,
|
||||
_view)
|
||||
};
|
||||
|
||||
BlurayInfo = new BlurayInfo
|
||||
{
|
||||
DataContext = new BlurayInfoViewModel(scsiInfo.BlurayDiscInformation, scsiInfo.BlurayBurstCuttingArea,
|
||||
scsiInfo.BlurayDds, scsiInfo.BlurayCartridgeStatus,
|
||||
scsiInfo.BluraySpareAreaInformation, scsiInfo.BlurayPowResources,
|
||||
scsiInfo.BlurayTrackResources, scsiInfo.BlurayRawDfl,
|
||||
scsiInfo.BlurayPac, _view)
|
||||
DataContext = new BlurayInfoViewModel(scsiInfo.BlurayDiscInformation,
|
||||
scsiInfo.BlurayBurstCuttingArea,
|
||||
scsiInfo.BlurayDds,
|
||||
scsiInfo.BlurayCartridgeStatus,
|
||||
scsiInfo.BluraySpareAreaInformation,
|
||||
scsiInfo.BlurayPowResources,
|
||||
scsiInfo.BlurayTrackResources,
|
||||
scsiInfo.BlurayRawDfl,
|
||||
scsiInfo.BlurayPac,
|
||||
_view)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -370,8 +402,7 @@ public sealed class MediaInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(data, 0, data.Length);
|
||||
@@ -400,21 +431,23 @@ public sealed class MediaInfoViewModel : ViewModelBase
|
||||
switch(_scsiInfo.MediaType)
|
||||
{
|
||||
case CommonTypes.MediaType.GDR or CommonTypes.MediaType.GDROM:
|
||||
await MessageBoxManager.
|
||||
GetMessageBoxStandard(UI.Title_Error,
|
||||
Localization.Core.GD_ROM_dump_support_is_not_yet_implemented, ButtonEnum.Ok,
|
||||
Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
await MessageBoxManager
|
||||
.GetMessageBoxStandard(UI.Title_Error,
|
||||
Localization.Core.GD_ROM_dump_support_is_not_yet_implemented,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
return;
|
||||
case CommonTypes.MediaType.XGD or CommonTypes.MediaType.XGD2 or CommonTypes.MediaType.XGD3
|
||||
when _scsiInfo.DeviceInfo.ScsiInquiry?.KreonPresent != true:
|
||||
await MessageBoxManager.
|
||||
GetMessageBoxStandard(UI.Title_Error,
|
||||
Localization.Core.
|
||||
Dumping_Xbox_Game_Discs_requires_a_drive_with_Kreon_firmware,
|
||||
ButtonEnum.Ok, Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
await MessageBoxManager
|
||||
.GetMessageBoxStandard(UI.Title_Error,
|
||||
Localization.Core
|
||||
.Dumping_Xbox_Game_Discs_requires_a_drive_with_Kreon_firmware,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -434,11 +467,12 @@ public sealed class MediaInfoViewModel : ViewModelBase
|
||||
// TODO: GD-ROM
|
||||
case CommonTypes.MediaType.GDR:
|
||||
case CommonTypes.MediaType.GDROM:
|
||||
await MessageBoxManager.
|
||||
GetMessageBoxStandard(UI.Title_Error,
|
||||
Localization.Core.GD_ROM_scan_support_is_not_yet_implemented, ButtonEnum.Ok,
|
||||
Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
await MessageBoxManager
|
||||
.GetMessageBoxStandard(UI.Title_Error,
|
||||
Localization.Core.GD_ROM_scan_support_is_not_yet_implemented,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
return;
|
||||
|
||||
@@ -447,10 +481,11 @@ public sealed class MediaInfoViewModel : ViewModelBase
|
||||
case CommonTypes.MediaType.XGD2:
|
||||
case CommonTypes.MediaType.XGD3:
|
||||
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||
Localization.Core.
|
||||
Scanning_Xbox_discs_is_not_yet_supported,
|
||||
ButtonEnum.Ok, Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
Localization.Core
|
||||
.Scanning_Xbox_discs_is_not_yet_supported,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,8 @@ public sealed class PartitionViewModel(Partition partition)
|
||||
string.Format(Localization.Core.Partition_start_sector_0_byte_1, partition.Start, partition.Offset);
|
||||
|
||||
public string LengthText { get; } = string.Format(Localization.Core.Partition_length_0_sectors_1_bytes,
|
||||
partition.Length, partition.Size);
|
||||
partition.Length,
|
||||
partition.Size);
|
||||
|
||||
public string DescriptionLabelText { get; } = Localization.Core.Title_Partition_description;
|
||||
public string DescriptionText { get; } = partition.Description;
|
||||
|
||||
@@ -73,8 +73,11 @@ public sealed class SubdirectoryViewModel
|
||||
{
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||
string.Format(UI.Error_0_trying_to_read_1_of_chosen_filesystem,
|
||||
errno, model.Path), ButtonEnum.Ok, Icon.Error).
|
||||
ShowWindowDialogAsync(view);
|
||||
errno,
|
||||
model.Path),
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(view);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -85,9 +88,10 @@ public sealed class SubdirectoryViewModel
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
AaruConsole.
|
||||
ErrorWriteLine(string.Format(UI.Error_0_trying_to_get_information_about_filesystem_entry_named_1,
|
||||
errno, dirent));
|
||||
AaruConsole
|
||||
.ErrorWriteLine(string.Format(UI.Error_0_trying_to_get_information_about_filesystem_entry_named_1,
|
||||
errno,
|
||||
dirent));
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -135,8 +139,7 @@ public sealed class SubdirectoryViewModel
|
||||
|
||||
async Task ExecuteExtractFilesCommand()
|
||||
{
|
||||
if(SelectedEntries.Count == 0)
|
||||
return;
|
||||
if(SelectedEntries.Count == 0) return;
|
||||
|
||||
var saveFilesFolderDialog = new OpenFolderDialog
|
||||
{
|
||||
@@ -145,8 +148,7 @@ public sealed class SubdirectoryViewModel
|
||||
|
||||
string result = await saveFilesFolderDialog.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
Statistics.AddCommand("extract-files");
|
||||
|
||||
@@ -268,11 +270,14 @@ public sealed class SubdirectoryViewModel
|
||||
string corrected = new(chars);
|
||||
|
||||
mboxResult = await MessageBoxManager.GetMessageBoxStandard(UI.Unsupported_filename,
|
||||
string.
|
||||
Format(UI.Filename_0_not_supported_want_to_rename_to_1,
|
||||
filename, corrected),
|
||||
ButtonEnum.YesNoCancel, Icon.Warning).
|
||||
ShowWindowDialogAsync(_view);
|
||||
string
|
||||
.Format(UI
|
||||
.Filename_0_not_supported_want_to_rename_to_1,
|
||||
filename,
|
||||
corrected),
|
||||
ButtonEnum.YesNoCancel,
|
||||
Icon.Warning)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
switch(mboxResult)
|
||||
{
|
||||
@@ -293,11 +298,12 @@ public sealed class SubdirectoryViewModel
|
||||
if(File.Exists(outputPath))
|
||||
{
|
||||
mboxResult = await MessageBoxManager.GetMessageBoxStandard(UI.Existing_file,
|
||||
string.
|
||||
Format(UI.File_named_0_exists_overwrite_Q,
|
||||
string
|
||||
.Format(UI.File_named_0_exists_overwrite_Q,
|
||||
filename),
|
||||
ButtonEnum.YesNoCancel, Icon.Warning).
|
||||
ShowWindowDialogAsync(_view);
|
||||
ButtonEnum.YesNoCancel,
|
||||
Icon.Warning)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
switch(mboxResult)
|
||||
{
|
||||
@@ -315,11 +321,10 @@ public sealed class SubdirectoryViewModel
|
||||
mboxResult = await MessageBoxManager.GetMessageBoxStandard(UI.Cannot_delete,
|
||||
UI.Could_note_delete_existe_file_continue_Q,
|
||||
ButtonEnum.YesNo,
|
||||
Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
if(mboxResult == ButtonResult.No)
|
||||
return;
|
||||
if(mboxResult == ButtonResult.No) return;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -341,14 +346,15 @@ public sealed class SubdirectoryViewModel
|
||||
if(error != ErrorNumber.NoError)
|
||||
{
|
||||
mboxResult = await MessageBoxManager.GetMessageBoxStandard(UI.Error_reading_file,
|
||||
string.
|
||||
Format(UI.Error_0_reading_file_continue_Q,
|
||||
error), ButtonEnum.YesNo,
|
||||
Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
string
|
||||
.Format(UI
|
||||
.Error_0_reading_file_continue_Q,
|
||||
error),
|
||||
ButtonEnum.YesNo,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
if(mboxResult == ButtonResult.No)
|
||||
return;
|
||||
if(mboxResult == ButtonResult.No) return;
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -358,11 +364,10 @@ public sealed class SubdirectoryViewModel
|
||||
fs.Write(outBuf, 0, outBuf.Length);
|
||||
fs.Close();
|
||||
var fi = new FileInfo(outputPath);
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
try
|
||||
{
|
||||
if(file.Stat.CreationTimeUtc.HasValue)
|
||||
fi.CreationTimeUtc = file.Stat.CreationTimeUtc.Value;
|
||||
if(file.Stat.CreationTimeUtc.HasValue) fi.CreationTimeUtc = file.Stat.CreationTimeUtc.Value;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -371,8 +376,7 @@ public sealed class SubdirectoryViewModel
|
||||
|
||||
try
|
||||
{
|
||||
if(file.Stat.LastWriteTimeUtc.HasValue)
|
||||
fi.LastWriteTimeUtc = file.Stat.LastWriteTimeUtc.Value;
|
||||
if(file.Stat.LastWriteTimeUtc.HasValue) fi.LastWriteTimeUtc = file.Stat.LastWriteTimeUtc.Value;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -381,25 +385,24 @@ public sealed class SubdirectoryViewModel
|
||||
|
||||
try
|
||||
{
|
||||
if(file.Stat.AccessTimeUtc.HasValue)
|
||||
fi.LastAccessTimeUtc = file.Stat.AccessTimeUtc.Value;
|
||||
if(file.Stat.AccessTimeUtc.HasValue) fi.LastAccessTimeUtc = file.Stat.AccessTimeUtc.Value;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
}
|
||||
catch(IOException)
|
||||
{
|
||||
mboxResult = await MessageBoxManager.GetMessageBoxStandard(UI.Cannot_create_file,
|
||||
UI.
|
||||
Could_not_create_destination_file_continue_Q,
|
||||
ButtonEnum.YesNo, Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
UI
|
||||
.Could_not_create_destination_file_continue_Q,
|
||||
ButtonEnum.YesNo,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
if(mboxResult == ButtonResult.No)
|
||||
return;
|
||||
if(mboxResult == ButtonResult.No) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,7 @@ public sealed class AtaInfoViewModel : ViewModelBase
|
||||
_atapi = atapiIdentify;
|
||||
_view = view;
|
||||
|
||||
if(ataIdentify == null && atapiIdentify == null)
|
||||
return;
|
||||
if(ataIdentify == null && atapiIdentify == null) return;
|
||||
|
||||
if(ataIdentify != null)
|
||||
{
|
||||
@@ -127,15 +126,13 @@ public sealed class AtaInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
|
||||
if(_ata != null)
|
||||
saveFs.Write(_ata, 0, _ata.Length);
|
||||
else if(_atapi != null)
|
||||
saveFs.Write(_atapi, 0, _atapi.Length);
|
||||
saveFs.Write(_ata, 0, _ata.Length);
|
||||
else if(_atapi != null) saveFs.Write(_atapi, 0, _atapi.Length);
|
||||
|
||||
saveFs.Close();
|
||||
}
|
||||
@@ -155,8 +152,7 @@ public sealed class AtaInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveText.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
var saveSw = new StreamWriter(saveFs);
|
||||
|
||||
@@ -188,8 +188,7 @@ public sealed class BlurayInfoViewModel
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(data, 0, data.Length);
|
||||
|
||||
@@ -82,23 +82,17 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
if(decodedCompactDiscInformation.HasValue)
|
||||
CdInformationText = DiscInformation.Prettify000b(decodedCompactDiscInformation);
|
||||
|
||||
if(decodedToc.HasValue)
|
||||
CdTocText = TOC.Prettify(decodedToc);
|
||||
if(decodedToc.HasValue) CdTocText = TOC.Prettify(decodedToc);
|
||||
|
||||
if(fullToc.HasValue)
|
||||
CdFullTocText = FullTOC.Prettify(fullToc);
|
||||
if(fullToc.HasValue) CdFullTocText = FullTOC.Prettify(fullToc);
|
||||
|
||||
if(decodedSession.HasValue)
|
||||
CdSessionText = Session.Prettify(decodedSession);
|
||||
if(decodedSession.HasValue) CdSessionText = Session.Prettify(decodedSession);
|
||||
|
||||
if(decodedCdTextLeadIn.HasValue)
|
||||
CdTextText = CDTextOnLeadIn.Prettify(decodedCdTextLeadIn);
|
||||
if(decodedCdTextLeadIn.HasValue) CdTextText = CDTextOnLeadIn.Prettify(decodedCdTextLeadIn);
|
||||
|
||||
if(decodedAtip != null)
|
||||
CdAtipText = ATIP.Prettify(atip);
|
||||
if(decodedAtip != null) CdAtipText = ATIP.Prettify(atip);
|
||||
|
||||
if(!string.IsNullOrEmpty(mcn))
|
||||
McnText = mcn;
|
||||
if(!string.IsNullOrEmpty(mcn)) McnText = mcn;
|
||||
|
||||
if(isrcs is { Count: > 0 })
|
||||
{
|
||||
@@ -168,8 +162,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_compactDiscInformationData, 0, _compactDiscInformationData.Length);
|
||||
@@ -192,8 +185,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_tocData, 0, _tocData.Length);
|
||||
@@ -216,8 +208,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_rawTocData, 0, _rawTocData.Length);
|
||||
@@ -240,8 +231,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_sessionData, 0, _sessionData.Length);
|
||||
@@ -264,8 +254,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_cdTextLeadInData, 0, _cdTextLeadInData.Length);
|
||||
@@ -288,8 +277,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_atipData, 0, _atipData.Length);
|
||||
@@ -312,8 +300,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_pmaData, 0, _pmaData.Length);
|
||||
|
||||
@@ -89,11 +89,9 @@ public sealed class DvdInfoViewModel
|
||||
}
|
||||
*/
|
||||
|
||||
if(decodedPfi.HasValue)
|
||||
DvdPfiText = PFI.Prettify(decodedPfi);
|
||||
if(decodedPfi.HasValue) DvdPfiText = PFI.Prettify(decodedPfi);
|
||||
|
||||
if(cmi != null)
|
||||
DvdCmiText = CSS_CPRM.PrettifyLeadInCopyright(cmi);
|
||||
if(cmi != null) DvdCmiText = CSS_CPRM.PrettifyLeadInCopyright(cmi);
|
||||
|
||||
SaveDvdPfiVisible = pfi != null;
|
||||
SaveDvdDmiVisible = dmi != null;
|
||||
@@ -140,8 +138,7 @@ public sealed class DvdInfoViewModel
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(data, 0, data.Length);
|
||||
|
||||
@@ -169,14 +169,11 @@ public sealed class DvdWritableInfoViewModel
|
||||
}
|
||||
*/
|
||||
|
||||
if(dds != null)
|
||||
DvdRamDdsText = DDS.Prettify(dds);
|
||||
if(dds != null) DvdRamDdsText = DDS.Prettify(dds);
|
||||
|
||||
if(cartridgeStatus != null)
|
||||
DvdRamCartridgeStatusText = Cartridge.Prettify(cartridgeStatus);
|
||||
if(cartridgeStatus != null) DvdRamCartridgeStatusText = Cartridge.Prettify(cartridgeStatus);
|
||||
|
||||
if(spareArea != null)
|
||||
DvdRamSpareAreaInformationText = Spare.Prettify(spareArea);
|
||||
if(spareArea != null) DvdRamSpareAreaInformationText = Spare.Prettify(spareArea);
|
||||
|
||||
SaveDvdRamDdsVisible = dds != null;
|
||||
SaveDvdRamCartridgeStatusVisible = cartridgeStatus != null;
|
||||
@@ -267,8 +264,7 @@ public sealed class DvdWritableInfoViewModel
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(data, 0, data.Length);
|
||||
|
||||
@@ -55,8 +55,7 @@ public class PcmciaInfoViewModel : ViewModelBase
|
||||
|
||||
internal PcmciaInfoViewModel([CanBeNull] byte[] pcmciaCis, Window view)
|
||||
{
|
||||
if(pcmciaCis == null)
|
||||
return;
|
||||
if(pcmciaCis == null) return;
|
||||
|
||||
_cis = pcmciaCis;
|
||||
CisList = new ObservableCollection<PcmciaCisModel>();
|
||||
@@ -166,8 +165,7 @@ public class PcmciaInfoViewModel : ViewModelBase
|
||||
get => _selectedCis;
|
||||
set
|
||||
{
|
||||
if(_selectedCis == value)
|
||||
return;
|
||||
if(_selectedCis == value) return;
|
||||
|
||||
PcmciaCisText = value?.Description;
|
||||
this.RaiseAndSetIfChanged(ref _selectedCis, value);
|
||||
@@ -191,8 +189,7 @@ public class PcmciaInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_cis, 0, _cis.Length);
|
||||
|
||||
@@ -82,8 +82,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
SaveEvpdPageCommand = ReactiveCommand.Create(ExecuteSaveEvpdPageCommand);
|
||||
SaveMmcFeaturesCommand = ReactiveCommand.Create(ExecuteSaveMmcFeaturesCommand);
|
||||
|
||||
if(InquiryData == null || !scsiInquiry.HasValue)
|
||||
return;
|
||||
if(InquiryData == null || !scsiInquiry.HasValue) return;
|
||||
|
||||
ScsiInquiryText = Decoders.SCSI.Inquiry.Prettify(scsiInquiry);
|
||||
|
||||
@@ -513,51 +512,51 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
evpdDecodedPage = EVPD.DecodePageB4(page.Value);
|
||||
|
||||
break;
|
||||
case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
|
||||
ToLowerInvariant().
|
||||
Trim() ==
|
||||
case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification)
|
||||
.ToLowerInvariant()
|
||||
.Trim() ==
|
||||
"quantum":
|
||||
evpdPageTitle = UI.Quantum_Firmware_Build_Information_page;
|
||||
evpdDecodedPage = EVPD.PrettifyPage_C0_Quantum(page.Value);
|
||||
|
||||
break;
|
||||
case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
|
||||
ToLowerInvariant().
|
||||
Trim() ==
|
||||
case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification)
|
||||
.ToLowerInvariant()
|
||||
.Trim() ==
|
||||
"seagate":
|
||||
evpdPageTitle = UI.Seagate_Firmware_Numbers_page;
|
||||
evpdDecodedPage = EVPD.PrettifyPage_C0_Seagate(page.Value);
|
||||
|
||||
break;
|
||||
case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
|
||||
ToLowerInvariant().
|
||||
Trim() ==
|
||||
case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification)
|
||||
.ToLowerInvariant()
|
||||
.Trim() ==
|
||||
"ibm":
|
||||
evpdPageTitle = UI.IBM_Drive_Component_Revision_Levels_page;
|
||||
evpdDecodedPage = EVPD.PrettifyPage_C0_IBM(page.Value);
|
||||
|
||||
break;
|
||||
case 0xC1 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
|
||||
ToLowerInvariant().
|
||||
Trim() ==
|
||||
case 0xC1 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification)
|
||||
.ToLowerInvariant()
|
||||
.Trim() ==
|
||||
"ibm":
|
||||
evpdPageTitle = UI.IBM_Drive_Serial_Numbers_page;
|
||||
evpdDecodedPage = EVPD.PrettifyPage_C1_IBM(page.Value);
|
||||
|
||||
break;
|
||||
case 0xC0 or 0xC1
|
||||
when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
|
||||
ToLowerInvariant().
|
||||
Trim() ==
|
||||
when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification)
|
||||
.ToLowerInvariant()
|
||||
.Trim() ==
|
||||
"certance":
|
||||
evpdPageTitle = UI.Certance_Drive_Component_Revision_Levels_page;
|
||||
evpdDecodedPage = EVPD.PrettifyPage_C0_C1_Certance(page.Value);
|
||||
|
||||
break;
|
||||
case 0xC2 or 0xC3 or 0xC4 or 0xC5 or 0xC6
|
||||
when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
|
||||
ToLowerInvariant().
|
||||
Trim() ==
|
||||
when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification)
|
||||
.ToLowerInvariant()
|
||||
.Trim() ==
|
||||
"certance":
|
||||
evpdPageTitle = page.Key switch
|
||||
{
|
||||
@@ -573,9 +572,9 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
break;
|
||||
case 0xC0 or 0xC1 or 0xC2 or 0xC3 or 0xC4 or 0xC5
|
||||
when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
|
||||
ToLowerInvariant().
|
||||
Trim() ==
|
||||
when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification)
|
||||
.ToLowerInvariant()
|
||||
.Trim() ==
|
||||
"hp":
|
||||
evpdPageTitle = page.Key switch
|
||||
{
|
||||
@@ -591,9 +590,9 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
evpdDecodedPage = EVPD.PrettifyPage_C0_to_C5_HP(page.Value);
|
||||
|
||||
break;
|
||||
case 0xDF when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
|
||||
ToLowerInvariant().
|
||||
Trim() ==
|
||||
case 0xDF when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification)
|
||||
.ToLowerInvariant()
|
||||
.Trim() ==
|
||||
"certance":
|
||||
evpdPageTitle = UI.Certance_drive_status_page;
|
||||
evpdDecodedPage = EVPD.PrettifyPage_DF_Certance(page.Value);
|
||||
@@ -601,13 +600,13 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if(page.Key == 0x00)
|
||||
continue;
|
||||
if(page.Key == 0x00) continue;
|
||||
|
||||
evpdPageTitle = string.Format(UI.Page_0_h, page.Key);
|
||||
evpdDecodedPage = UI.Undecoded;
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Found_undecoded_SCSI_VPD_page_0,
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.Core.Found_undecoded_SCSI_VPD_page_0,
|
||||
page.Key);
|
||||
|
||||
break;
|
||||
@@ -623,14 +622,14 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
if(_configuration == null)
|
||||
return;
|
||||
if(_configuration == null) return;
|
||||
|
||||
Features.SeparatedFeatures ftr = Features.Separate(_configuration);
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.GET_CONFIGURATION_length_is_0, ftr.DataLength);
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.GET_CONFIGURATION_current_profile_is_0,
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.Core.GET_CONFIGURATION_current_profile_is_0,
|
||||
ftr.CurrentProfile);
|
||||
|
||||
if(ftr.Descriptors != null)
|
||||
@@ -734,11 +733,9 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
get => _selectedModeSensePage;
|
||||
set
|
||||
{
|
||||
if(value == _selectedModeSensePage)
|
||||
return;
|
||||
if(value == _selectedModeSensePage) return;
|
||||
|
||||
if(value is ScsiPageModel pageModel)
|
||||
ModeSensePageText = pageModel.Description;
|
||||
if(value is ScsiPageModel pageModel) ModeSensePageText = pageModel.Description;
|
||||
|
||||
this.RaiseAndSetIfChanged(ref _selectedModeSensePage, value);
|
||||
}
|
||||
@@ -755,11 +752,9 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
get => _selectedEvpdPage;
|
||||
set
|
||||
{
|
||||
if(value == _selectedEvpdPage)
|
||||
return;
|
||||
if(value == _selectedEvpdPage) return;
|
||||
|
||||
if(value is ScsiPageModel pageModel)
|
||||
EvpdPageText = pageModel.Description;
|
||||
if(value is ScsiPageModel pageModel) EvpdPageText = pageModel.Description;
|
||||
|
||||
this.RaiseAndSetIfChanged(ref _selectedEvpdPage, value);
|
||||
}
|
||||
@@ -776,11 +771,9 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
get => _selectedMmcFeature;
|
||||
set
|
||||
{
|
||||
if(value == _selectedMmcFeature)
|
||||
return;
|
||||
if(value == _selectedMmcFeature) return;
|
||||
|
||||
if(value is ScsiPageModel pageModel)
|
||||
MmcFeatureText = pageModel.Description;
|
||||
if(value is ScsiPageModel pageModel) MmcFeatureText = pageModel.Description;
|
||||
|
||||
this.RaiseAndSetIfChanged(ref _selectedMmcFeature, value);
|
||||
}
|
||||
@@ -821,8 +814,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(InquiryData, 0, InquiryData.Length);
|
||||
@@ -845,8 +837,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveText.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
var saveSw = new StreamWriter(saveFs);
|
||||
@@ -869,8 +860,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_scsiModeSense6, 0, _scsiModeSense6.Length);
|
||||
@@ -893,8 +883,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_scsiModeSense10, 0, _scsiModeSense10.Length);
|
||||
@@ -904,8 +893,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
async Task ExecuteSaveEvpdPageCommand()
|
||||
{
|
||||
if(SelectedEvpdPage is not ScsiPageModel pageModel)
|
||||
return;
|
||||
if(SelectedEvpdPage is not ScsiPageModel pageModel) return;
|
||||
|
||||
var dlgSaveBinary = new SaveFileDialog();
|
||||
|
||||
@@ -920,8 +908,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(pageModel.Data, 0, pageModel.Data.Length);
|
||||
@@ -944,8 +931,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(_configuration, 0, _configuration.Length);
|
||||
|
||||
@@ -47,17 +47,13 @@ public sealed class SdMmcInfoViewModel
|
||||
{
|
||||
//Text = "MultiMediaCard";
|
||||
|
||||
if(cid != null)
|
||||
CidText = Decoders.MMC.Decoders.PrettifyCID(cid);
|
||||
if(cid != null) CidText = Decoders.MMC.Decoders.PrettifyCID(cid);
|
||||
|
||||
if(csd != null)
|
||||
CsdText = Decoders.MMC.Decoders.PrettifyCSD(csd);
|
||||
if(csd != null) CsdText = Decoders.MMC.Decoders.PrettifyCSD(csd);
|
||||
|
||||
if(ocr != null)
|
||||
OcrText = Decoders.MMC.Decoders.PrettifyOCR(ocr);
|
||||
if(ocr != null) OcrText = Decoders.MMC.Decoders.PrettifyOCR(ocr);
|
||||
|
||||
if(extendedCsd != null)
|
||||
ExtendedCsdText = Decoders.MMC.Decoders.PrettifyExtendedCSD(extendedCsd);
|
||||
if(extendedCsd != null) ExtendedCsdText = Decoders.MMC.Decoders.PrettifyExtendedCSD(extendedCsd);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -65,17 +61,13 @@ public sealed class SdMmcInfoViewModel
|
||||
{
|
||||
//Text = "SecureDigital";
|
||||
|
||||
if(cid != null)
|
||||
CidText = Decoders.SecureDigital.Decoders.PrettifyCID(cid);
|
||||
if(cid != null) CidText = Decoders.SecureDigital.Decoders.PrettifyCID(cid);
|
||||
|
||||
if(csd != null)
|
||||
CsdText = Decoders.SecureDigital.Decoders.PrettifyCSD(csd);
|
||||
if(csd != null) CsdText = Decoders.SecureDigital.Decoders.PrettifyCSD(csd);
|
||||
|
||||
if(ocr != null)
|
||||
OcrText = Decoders.SecureDigital.Decoders.PrettifyOCR(ocr);
|
||||
if(ocr != null) OcrText = Decoders.SecureDigital.Decoders.PrettifyOCR(ocr);
|
||||
|
||||
if(scr != null)
|
||||
ScrText = Decoders.SecureDigital.Decoders.PrettifySCR(scr);
|
||||
if(scr != null) ScrText = Decoders.SecureDigital.Decoders.PrettifySCR(scr);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -69,13 +69,11 @@ public sealed class XboxInfoViewModel
|
||||
if(dmi != null)
|
||||
{
|
||||
if(DMI.IsXbox(dmi))
|
||||
XboxDmiText = DMI.PrettifyXbox(dmi);
|
||||
else if(DMI.IsXbox360(dmi))
|
||||
XboxDmiText = DMI.PrettifyXbox360(dmi);
|
||||
XboxDmiText = DMI.PrettifyXbox(dmi);
|
||||
else if(DMI.IsXbox360(dmi)) XboxDmiText = DMI.PrettifyXbox360(dmi);
|
||||
}
|
||||
|
||||
if(decodedSecuritySector.HasValue)
|
||||
XboxSsText = SS.Prettify(decodedSecuritySector);
|
||||
if(decodedSecuritySector.HasValue) XboxSsText = SS.Prettify(decodedSecuritySector);
|
||||
|
||||
SaveXboxSsVisible = securitySector != null;
|
||||
}
|
||||
@@ -117,8 +115,7 @@ public sealed class XboxInfoViewModel
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
if(result is null) return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(data, 0, data.Length);
|
||||
|
||||
@@ -97,8 +97,7 @@ public sealed class DecodeMediaTagsViewModel : ViewModelBase
|
||||
{
|
||||
this.RaiseAndSetIfChanged(ref _selectedTag, value);
|
||||
|
||||
if(value is null)
|
||||
return;
|
||||
if(value is null) return;
|
||||
|
||||
// TODO: Decoders should be able to handle tags with/without length header
|
||||
HexViewText = PrintHex.ByteArrayToHexArrayString(value.Data, HEX_COLUMNS);
|
||||
@@ -230,8 +229,7 @@ public sealed class DecodeMediaTagsViewModel : ViewModelBase
|
||||
break;
|
||||
}
|
||||
|
||||
if(DecodedText != null)
|
||||
value.Decoded = DecodedText;
|
||||
if(DecodedText != null) value.Decoded = DecodedText;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -430,41 +430,29 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
|
||||
var enabledChecksums = new EnableChecksum();
|
||||
|
||||
if(Adler32Checked)
|
||||
enabledChecksums |= EnableChecksum.Adler32;
|
||||
if(Adler32Checked) enabledChecksums |= EnableChecksum.Adler32;
|
||||
|
||||
if(Crc16Checked)
|
||||
enabledChecksums |= EnableChecksum.Crc16;
|
||||
if(Crc16Checked) enabledChecksums |= EnableChecksum.Crc16;
|
||||
|
||||
if(Crc32Checked)
|
||||
enabledChecksums |= EnableChecksum.Crc32;
|
||||
if(Crc32Checked) enabledChecksums |= EnableChecksum.Crc32;
|
||||
|
||||
if(Crc64Checked)
|
||||
enabledChecksums |= EnableChecksum.Crc64;
|
||||
if(Crc64Checked) enabledChecksums |= EnableChecksum.Crc64;
|
||||
|
||||
if(Md5Checked)
|
||||
enabledChecksums |= EnableChecksum.Md5;
|
||||
if(Md5Checked) enabledChecksums |= EnableChecksum.Md5;
|
||||
|
||||
if(Sha1Checked)
|
||||
enabledChecksums |= EnableChecksum.Sha1;
|
||||
if(Sha1Checked) enabledChecksums |= EnableChecksum.Sha1;
|
||||
|
||||
if(Sha256Checked)
|
||||
enabledChecksums |= EnableChecksum.Sha256;
|
||||
if(Sha256Checked) enabledChecksums |= EnableChecksum.Sha256;
|
||||
|
||||
if(Sha384Checked)
|
||||
enabledChecksums |= EnableChecksum.Sha384;
|
||||
if(Sha384Checked) enabledChecksums |= EnableChecksum.Sha384;
|
||||
|
||||
if(Sha512Checked)
|
||||
enabledChecksums |= EnableChecksum.Sha512;
|
||||
if(Sha512Checked) enabledChecksums |= EnableChecksum.Sha512;
|
||||
|
||||
if(SpamsumChecked)
|
||||
enabledChecksums |= EnableChecksum.SpamSum;
|
||||
if(SpamsumChecked) enabledChecksums |= EnableChecksum.SpamSum;
|
||||
|
||||
if(Fletcher16Checked)
|
||||
enabledChecksums |= EnableChecksum.Fletcher16;
|
||||
if(Fletcher16Checked) enabledChecksums |= EnableChecksum.Fletcher16;
|
||||
|
||||
if(Fletcher32Checked)
|
||||
enabledChecksums |= EnableChecksum.Fletcher32;
|
||||
if(Fletcher32Checked) enabledChecksums |= EnableChecksum.Fletcher32;
|
||||
|
||||
Checksum mediaChecksum = null;
|
||||
ErrorNumber errno;
|
||||
@@ -475,8 +463,7 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
{
|
||||
Checksum trackChecksum = null;
|
||||
|
||||
if(ChecksumMediaChecked)
|
||||
mediaChecksum = new Checksum(enabledChecksums);
|
||||
if(ChecksumMediaChecked) mediaChecksum = new Checksum(enabledChecksums);
|
||||
|
||||
ulong previousTrackEnd = 0;
|
||||
|
||||
@@ -484,7 +471,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
{
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
ProgressText = string.Format(UI.Hashing_track_0_of_1, currentTrack.Sequence,
|
||||
ProgressText = string.Format(UI.Hashing_track_0_of_1,
|
||||
currentTrack.Sequence,
|
||||
opticalMediaImage.Tracks.Count);
|
||||
|
||||
ProgressValue++;
|
||||
@@ -507,7 +495,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Core.Error_0_reading_sector_1,
|
||||
errno, i));
|
||||
errno,
|
||||
i));
|
||||
|
||||
_cancel = true;
|
||||
|
||||
@@ -518,11 +507,13 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, UI.Track_0_starts_at_sector_1_and_ends_at_sector_2,
|
||||
currentTrack.Sequence, currentTrack.StartSector, currentTrack.EndSector);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
UI.Track_0_starts_at_sector_1_and_ends_at_sector_2,
|
||||
currentTrack.Sequence,
|
||||
currentTrack.StartSector,
|
||||
currentTrack.EndSector);
|
||||
|
||||
if(ChecksumTracksChecked)
|
||||
trackChecksum = new Checksum(enabledChecksums);
|
||||
if(ChecksumTracksChecked) trackChecksum = new Checksum(enabledChecksums);
|
||||
|
||||
ulong sectors = currentTrack.EndSector - currentTrack.StartSector + 1;
|
||||
ulong doneSectors = 0;
|
||||
@@ -545,13 +536,16 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
|
||||
if(sectors - doneSectors >= SECTORS_TO_READ)
|
||||
{
|
||||
errno = opticalMediaImage.ReadSectors(doneSectors, SECTORS_TO_READ, currentTrack.Sequence,
|
||||
errno = opticalMediaImage.ReadSectors(doneSectors,
|
||||
SECTORS_TO_READ,
|
||||
currentTrack.Sequence,
|
||||
out sector);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Core.Error_0_reading_sector_1,
|
||||
errno, doneSectors));
|
||||
errno,
|
||||
doneSectors));
|
||||
|
||||
_cancel = true;
|
||||
|
||||
@@ -572,13 +566,16 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
}
|
||||
else
|
||||
{
|
||||
errno = opticalMediaImage.ReadSectors(doneSectors, (uint)(sectors - doneSectors),
|
||||
currentTrack.Sequence, out sector);
|
||||
errno = opticalMediaImage.ReadSectors(doneSectors,
|
||||
(uint)(sectors - doneSectors),
|
||||
currentTrack.Sequence,
|
||||
out sector);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Core.Error_0_reading_sector_1,
|
||||
errno, doneSectors));
|
||||
errno,
|
||||
doneSectors));
|
||||
|
||||
_cancel = true;
|
||||
|
||||
@@ -599,20 +596,16 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
doneSectors += sectors - doneSectors;
|
||||
}
|
||||
|
||||
if(ChecksumMediaChecked)
|
||||
mediaChecksum?.Update(sector);
|
||||
if(ChecksumMediaChecked) mediaChecksum?.Update(sector);
|
||||
|
||||
if(ChecksumTracksChecked)
|
||||
trackChecksum?.Update(sector);
|
||||
if(ChecksumTracksChecked) trackChecksum?.Update(sector);
|
||||
}
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
if(ChecksumTracksChecked != true)
|
||||
return;
|
||||
if(ChecksumTracksChecked != true) return;
|
||||
|
||||
if(trackChecksum == null)
|
||||
return;
|
||||
if(trackChecksum == null) return;
|
||||
|
||||
foreach(CommonTypes.AaruMetadata.Checksum chk in trackChecksum.End())
|
||||
{
|
||||
@@ -644,7 +637,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Core.Error_0_reading_sector_1, errno,
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Core.Error_0_reading_sector_1,
|
||||
errno,
|
||||
i));
|
||||
|
||||
_cancel = true;
|
||||
@@ -658,8 +652,7 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
if(mediaChecksum == null)
|
||||
return;
|
||||
if(mediaChecksum == null) return;
|
||||
|
||||
foreach(CommonTypes.AaruMetadata.Checksum chk in mediaChecksum.End())
|
||||
{
|
||||
@@ -708,7 +701,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Core.Error_0_reading_sector_1, errno,
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Core.Error_0_reading_sector_1,
|
||||
errno,
|
||||
doneSectors));
|
||||
|
||||
_cancel = true;
|
||||
@@ -722,7 +716,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
{
|
||||
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
|
||||
|
||||
Progress2Text = string.Format(UI.Hashing_sectors_0_to_1, doneSectorsToInvoke,
|
||||
Progress2Text = string.Format(UI.Hashing_sectors_0_to_1,
|
||||
doneSectorsToInvoke,
|
||||
doneSectorsToInvoke + SECTORS_TO_READ);
|
||||
});
|
||||
|
||||
@@ -730,12 +725,14 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
}
|
||||
else
|
||||
{
|
||||
errno = _inputFormat.ReadSectors(doneSectors, (uint)(_inputFormat.Info.Sectors - doneSectors),
|
||||
errno = _inputFormat.ReadSectors(doneSectors,
|
||||
(uint)(_inputFormat.Info.Sectors - doneSectors),
|
||||
out sector);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Core.Error_0_reading_sector_1, errno,
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Core.Error_0_reading_sector_1,
|
||||
errno,
|
||||
doneSectors));
|
||||
|
||||
_cancel = true;
|
||||
@@ -749,7 +746,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
{
|
||||
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
|
||||
|
||||
Progress2Text = string.Format(UI.Hashing_sectors_0_to_1, doneSectorsToInvoke,
|
||||
Progress2Text = string.Format(UI.Hashing_sectors_0_to_1,
|
||||
doneSectorsToInvoke,
|
||||
doneSectorsToInvoke +
|
||||
(_inputFormat.Info.Sectors - doneSectorsToInvoke));
|
||||
});
|
||||
@@ -773,11 +771,9 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
});
|
||||
}
|
||||
|
||||
if(ChecksumTracksChecked)
|
||||
await Dispatcher.UIThread.InvokeAsync(() => { TrackChecksumsVisible = true; });
|
||||
if(ChecksumTracksChecked) await Dispatcher.UIThread.InvokeAsync(() => { TrackChecksumsVisible = true; });
|
||||
|
||||
if(ChecksumMediaChecked)
|
||||
await Dispatcher.UIThread.InvokeAsync(() => { MediaChecksumsVisible = true; });
|
||||
if(ChecksumMediaChecked) await Dispatcher.UIThread.InvokeAsync(() => { MediaChecksumsVisible = true; });
|
||||
|
||||
Statistics.AddCommand("checksum");
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -333,15 +333,15 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
||||
|
||||
if(trackEntropy.UniqueSectors != null)
|
||||
{
|
||||
AaruConsole.WriteLine(UI.Track_0_has_1_unique_sectors_2, trackEntropy.Track,
|
||||
AaruConsole.WriteLine(UI.Track_0_has_1_unique_sectors_2,
|
||||
trackEntropy.Track,
|
||||
trackEntropy.UniqueSectors,
|
||||
(double)trackEntropy.UniqueSectors / trackEntropy.Sectors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(WholeDiscChecked != true)
|
||||
return;
|
||||
if(WholeDiscChecked != true) return;
|
||||
|
||||
_entropy = entropyCalculator.CalculateMediaEntropy(DuplicatedSectorsChecked);
|
||||
|
||||
@@ -374,16 +374,15 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
if(WholeDiscChecked != true)
|
||||
return;
|
||||
if(WholeDiscChecked != true) return;
|
||||
|
||||
MediaEntropyText = string.Format(UI.Entropy_for_disk_is_0, _entropy.Entropy);
|
||||
MediaEntropyVisible = true;
|
||||
|
||||
if(_entropy.UniqueSectors == null)
|
||||
return;
|
||||
if(_entropy.UniqueSectors == null) return;
|
||||
|
||||
MediaUniqueSectorsText = string.Format(UI.Disk_has_0_unique_sectors_1, _entropy.UniqueSectors,
|
||||
MediaUniqueSectorsText = string.Format(UI.Disk_has_0_unique_sectors_1,
|
||||
_entropy.UniqueSectors,
|
||||
(double)_entropy.UniqueSectors / _entropy.Sectors);
|
||||
|
||||
MediaUniqueSectorsVisible = true;
|
||||
@@ -413,8 +412,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
||||
return;
|
||||
}
|
||||
|
||||
if(ProgressIndeterminate)
|
||||
ProgressIndeterminate = false;
|
||||
if(ProgressIndeterminate) ProgressIndeterminate = false;
|
||||
|
||||
ProgressMax = maximum;
|
||||
ProgressValue = current;
|
||||
@@ -432,8 +430,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
||||
return;
|
||||
}
|
||||
|
||||
if(Progress2Indeterminate)
|
||||
Progress2Indeterminate = false;
|
||||
if(Progress2Indeterminate) Progress2Indeterminate = false;
|
||||
|
||||
Progress2Max = maximum;
|
||||
Progress2Value = current;
|
||||
|
||||
@@ -256,10 +256,13 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
||||
|
||||
var jsonFs = new FileStream(DestinationText, FileMode.Create);
|
||||
|
||||
await JsonSerializer.SerializeAsync(jsonFs, new MetadataJson
|
||||
{
|
||||
AaruMetadata = sidecar
|
||||
}, typeof(MetadataJson), MetadataJsonContext.Default);
|
||||
await JsonSerializer.SerializeAsync(jsonFs,
|
||||
new MetadataJson
|
||||
{
|
||||
AaruMetadata = sidecar
|
||||
},
|
||||
typeof(MetadataJson),
|
||||
MetadataJsonContext.Default);
|
||||
|
||||
jsonFs.Close();
|
||||
|
||||
@@ -343,8 +346,7 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
||||
return;
|
||||
}
|
||||
|
||||
if(string.IsNullOrEmpty(Path.GetExtension(result)))
|
||||
result += ".json";
|
||||
if(string.IsNullOrEmpty(Path.GetExtension(result))) result += ".json";
|
||||
|
||||
DestinationText = result;
|
||||
}
|
||||
|
||||
@@ -376,8 +376,7 @@ public sealed class ImageVerifyViewModel : ViewModelBase
|
||||
ProgressVisible = true;
|
||||
ProgressMaxValue = 0;
|
||||
|
||||
if(VerifyImageChecked || VerifySectorsChecked)
|
||||
ProgressMaxValue = 1;
|
||||
if(VerifyImageChecked || VerifySectorsChecked) ProgressMaxValue = 1;
|
||||
|
||||
if(formatHasTracks && inputOptical != null)
|
||||
ProgressMaxValue += inputOptical.Tracks.Count;
|
||||
@@ -469,7 +468,8 @@ public sealed class ImageVerifyViewModel : ViewModelBase
|
||||
{
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
ProgressText = string.Format(UI.Verifying_track_0_of_1, currentTrack.Sequence,
|
||||
ProgressText = string.Format(UI.Verifying_track_0_of_1,
|
||||
currentTrack.Sequence,
|
||||
inputOptical.Tracks.Count);
|
||||
|
||||
ProgressValue++;
|
||||
@@ -498,8 +498,10 @@ public sealed class ImageVerifyViewModel : ViewModelBase
|
||||
{
|
||||
Progress2Value = all / 512d;
|
||||
|
||||
Progress2Text = string.Format(UI.Checking_sector_0_of_1_on_track_2, all,
|
||||
_inputFormat.Info.Sectors, currentTrack.Sequence);
|
||||
Progress2Text = string.Format(UI.Checking_sector_0_of_1_on_track_2,
|
||||
all,
|
||||
_inputFormat.Info.Sectors,
|
||||
currentTrack.Sequence);
|
||||
});
|
||||
|
||||
List<ulong> tempFailingLbas;
|
||||
@@ -507,12 +509,18 @@ public sealed class ImageVerifyViewModel : ViewModelBase
|
||||
|
||||
if(remainingSectors < 512)
|
||||
{
|
||||
inputOptical.VerifySectors(currentSector, (uint)remainingSectors, currentTrack.Sequence,
|
||||
out tempFailingLbas, out tempUnknownLbas);
|
||||
inputOptical.VerifySectors(currentSector,
|
||||
(uint)remainingSectors,
|
||||
currentTrack.Sequence,
|
||||
out tempFailingLbas,
|
||||
out tempUnknownLbas);
|
||||
}
|
||||
else
|
||||
{
|
||||
inputOptical.VerifySectors(currentSector, 512, currentTrack.Sequence, out tempFailingLbas,
|
||||
inputOptical.VerifySectors(currentSector,
|
||||
512,
|
||||
currentTrack.Sequence,
|
||||
out tempFailingLbas,
|
||||
out tempUnknownLbas);
|
||||
}
|
||||
|
||||
@@ -571,12 +579,16 @@ public sealed class ImageVerifyViewModel : ViewModelBase
|
||||
|
||||
if(remainingSectors < 512)
|
||||
{
|
||||
verifiableSectorsImage.VerifySectors(currentSector, (uint)remainingSectors, out tempFailingLbas,
|
||||
verifiableSectorsImage.VerifySectors(currentSector,
|
||||
(uint)remainingSectors,
|
||||
out tempFailingLbas,
|
||||
out tempUnknownLbas);
|
||||
}
|
||||
else
|
||||
{
|
||||
verifiableSectorsImage.VerifySectors(currentSector, 512, out tempFailingLbas,
|
||||
verifiableSectorsImage.VerifySectors(currentSector,
|
||||
512,
|
||||
out tempFailingLbas,
|
||||
out tempUnknownLbas);
|
||||
}
|
||||
|
||||
|
||||
@@ -147,12 +147,13 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
new Bitmap(AssetLoader.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/inode-directory.png")));
|
||||
|
||||
_usbIcon =
|
||||
new Bitmap(AssetLoader.
|
||||
Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media-usb.png")));
|
||||
new
|
||||
Bitmap(AssetLoader.Open(new
|
||||
Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media-usb.png")));
|
||||
|
||||
_removableIcon =
|
||||
new Bitmap(AssetLoader.
|
||||
Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media.png")));
|
||||
new
|
||||
Bitmap(AssetLoader.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media.png")));
|
||||
|
||||
_sdIcon =
|
||||
new Bitmap(AssetLoader.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/media-flash-sd-mmc.png")));
|
||||
@@ -193,8 +194,9 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
get
|
||||
{
|
||||
Window mainWindow = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.
|
||||
MainWindow;
|
||||
Window mainWindow = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)
|
||||
?.MainWindow;
|
||||
|
||||
return mainWindow is not null && NativeMenu.GetIsNativeMenuExported(mainWindow);
|
||||
}
|
||||
}
|
||||
@@ -231,8 +233,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
get => _treeViewSelectedItem;
|
||||
set
|
||||
{
|
||||
if(value == _treeViewSelectedItem)
|
||||
return;
|
||||
if(value == _treeViewSelectedItem) return;
|
||||
|
||||
this.RaiseAndSetIfChanged(ref _treeViewSelectedItem, value);
|
||||
|
||||
@@ -281,7 +282,8 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
return;
|
||||
case Devices.Remote.Device remoteDev:
|
||||
Statistics.AddRemote(remoteDev.RemoteApplication, remoteDev.RemoteVersion,
|
||||
Statistics.AddRemote(remoteDev.RemoteApplication,
|
||||
remoteDev.RemoteVersion,
|
||||
remoteDev.RemoteOperatingSystem,
|
||||
remoteDev.RemoteOperatingSystemVersion,
|
||||
remoteDev.RemoteArchitecture);
|
||||
@@ -375,8 +377,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
void ExecuteCalculateEntropyCommand()
|
||||
{
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel)
|
||||
return;
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel) return;
|
||||
|
||||
var imageEntropyWindow = new ImageEntropy();
|
||||
imageEntropyWindow.DataContext = new ImageEntropyViewModel(imageModel.Image, imageEntropyWindow);
|
||||
@@ -388,8 +389,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
void ExecuteVerifyImageCommand()
|
||||
{
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel)
|
||||
return;
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel) return;
|
||||
|
||||
var imageVerifyWindow = new ImageVerify();
|
||||
imageVerifyWindow.DataContext = new ImageVerifyViewModel(imageModel.Image, imageVerifyWindow);
|
||||
@@ -401,8 +401,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
void ExecuteChecksumImageCommand()
|
||||
{
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel)
|
||||
return;
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel) return;
|
||||
|
||||
var imageChecksumWindow = new ImageChecksum();
|
||||
imageChecksumWindow.DataContext = new ImageChecksumViewModel(imageModel.Image, imageChecksumWindow);
|
||||
@@ -414,8 +413,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
void ExecuteConvertImageCommand()
|
||||
{
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel)
|
||||
return;
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel) return;
|
||||
|
||||
var imageConvertWindow = new ImageConvert();
|
||||
|
||||
@@ -429,14 +427,16 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
void ExecuteCreateSidecarCommand()
|
||||
{
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel)
|
||||
return;
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel) return;
|
||||
|
||||
var imageSidecarWindow = new ImageSidecar();
|
||||
|
||||
// TODO: Pass thru chosen default encoding
|
||||
imageSidecarWindow.DataContext =
|
||||
new ImageSidecarViewModel(imageModel.Image, imageModel.Path, imageModel.Filter.Id, null,
|
||||
new ImageSidecarViewModel(imageModel.Image,
|
||||
imageModel.Path,
|
||||
imageModel.Filter.Id,
|
||||
null,
|
||||
imageSidecarWindow);
|
||||
|
||||
imageSidecarWindow.Show();
|
||||
@@ -444,8 +444,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
void ExecuteViewImageSectorsCommand()
|
||||
{
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel)
|
||||
return;
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel) return;
|
||||
|
||||
new ViewSector
|
||||
{
|
||||
@@ -455,8 +454,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
void ExecuteDecodeImageMediaTagsCommand()
|
||||
{
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel)
|
||||
return;
|
||||
if(TreeViewSelectedItem is not ImageModel imageModel) return;
|
||||
|
||||
new DecodeMediaTags
|
||||
{
|
||||
@@ -497,8 +495,8 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
!ctx.Partitions.Any() &&
|
||||
!ctx.SeenDevices.Any())
|
||||
{
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Warning, UI.There_are_no_statistics).
|
||||
ShowWindowDialogAsync(_view);
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Warning, UI.There_are_no_statistics)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -540,14 +538,15 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
string[] result = await dlgOpenImage.ShowAsync(_view);
|
||||
|
||||
if(result?.Length != 1)
|
||||
return;
|
||||
if(result?.Length != 1) return;
|
||||
|
||||
IFilter inputFilter = PluginRegister.Singleton.GetFilter(result[0]);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Cannot_open_specified_file, ButtonEnum.Ok,
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||
UI.Cannot_open_specified_file,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error);
|
||||
|
||||
return;
|
||||
@@ -557,7 +556,9 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
if(ImageFormat.Detect(inputFilter) is not IMediaImage imageFormat)
|
||||
{
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Image_format_not_identified, ButtonEnum.Ok,
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||
UI.Image_format_not_identified,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error);
|
||||
|
||||
return;
|
||||
@@ -573,7 +574,8 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||
string.Format(UI.Error_0_opening_image_format, opened),
|
||||
ButtonEnum.Ok, Icon.Error);
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error);
|
||||
|
||||
AaruConsole.ErrorWriteLine(UI.Unable_to_open_image_format);
|
||||
AaruConsole.ErrorWriteLine(UI.No_error_given);
|
||||
@@ -588,13 +590,10 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
Path = result[0],
|
||||
Icon = AssetLoader.Exists(mediaResource)
|
||||
? new Bitmap(AssetLoader.Open(mediaResource))
|
||||
:
|
||||
imageFormat.Info.MetadataMediaType == MetadataMediaType.BlockMedia
|
||||
: imageFormat.Info.MetadataMediaType == MetadataMediaType.BlockMedia
|
||||
? _genericHddIcon
|
||||
:
|
||||
imageFormat.Info.MetadataMediaType == MetadataMediaType.OpticalDisc
|
||||
?
|
||||
_genericOpticalIcon
|
||||
: imageFormat.Info.MetadataMediaType == MetadataMediaType.OpticalDisc
|
||||
? _genericOpticalIcon
|
||||
: _genericFolderIcon,
|
||||
FileName = Path.GetFileName(result[0]),
|
||||
Image = imageFormat,
|
||||
@@ -627,8 +626,8 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
Name = scheme
|
||||
};
|
||||
|
||||
foreach(CommonTypes.Partition partition in partitions.Where(p => p.Scheme == scheme).
|
||||
OrderBy(p => p.Start))
|
||||
foreach(CommonTypes.Partition partition in partitions.Where(p => p.Scheme == scheme)
|
||||
.OrderBy(p => p.Start))
|
||||
{
|
||||
var partitionModel = new PartitionModel
|
||||
{
|
||||
@@ -650,23 +649,26 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(!plugins.Filesystems.TryGetValue(pluginName, out IFilesystem fs))
|
||||
continue;
|
||||
if(fs is null)
|
||||
continue;
|
||||
if(!plugins.Filesystems.TryGetValue(pluginName, out IFilesystem fs)) continue;
|
||||
if(fs is null) continue;
|
||||
|
||||
fs.GetInformation(imageFormat, partition, null, out string information,
|
||||
fs.GetInformation(imageFormat,
|
||||
partition,
|
||||
null,
|
||||
out string information,
|
||||
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
||||
|
||||
var rofs = fs as IReadOnlyFilesystem;
|
||||
|
||||
if(rofs != null)
|
||||
{
|
||||
ErrorNumber error = rofs.Mount(imageFormat, partition, null,
|
||||
new Dictionary<string, string>(), null);
|
||||
ErrorNumber error = rofs.Mount(imageFormat,
|
||||
partition,
|
||||
null,
|
||||
new Dictionary<string, string>(),
|
||||
null);
|
||||
|
||||
if(error != ErrorNumber.NoError)
|
||||
rofs = null;
|
||||
if(error != ErrorNumber.NoError) rofs = null;
|
||||
}
|
||||
|
||||
var filesystemModel = new FileSystemModel
|
||||
@@ -725,23 +727,26 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(!plugins.Filesystems.TryGetValue(pluginName, out IFilesystem fs))
|
||||
continue;
|
||||
if(fs is null)
|
||||
continue;
|
||||
if(!plugins.Filesystems.TryGetValue(pluginName, out IFilesystem fs)) continue;
|
||||
if(fs is null) continue;
|
||||
|
||||
fs.GetInformation(imageFormat, wholePart, null, out string information,
|
||||
fs.GetInformation(imageFormat,
|
||||
wholePart,
|
||||
null,
|
||||
out string information,
|
||||
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
||||
|
||||
var rofs = fs as IReadOnlyFilesystem;
|
||||
|
||||
if(rofs != null)
|
||||
{
|
||||
ErrorNumber error = rofs.Mount(imageFormat, wholePart, null,
|
||||
new Dictionary<string, string>(), null);
|
||||
ErrorNumber error = rofs.Mount(imageFormat,
|
||||
wholePart,
|
||||
null,
|
||||
new Dictionary<string, string>(),
|
||||
null);
|
||||
|
||||
if(error != ErrorNumber.NoError)
|
||||
rofs = null;
|
||||
if(error != ErrorNumber.NoError) rofs = null;
|
||||
}
|
||||
|
||||
var filesystemModel = new FileSystemModel
|
||||
@@ -783,7 +788,9 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Unable_to_open_image_format, ButtonEnum.Ok,
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||
UI.Unable_to_open_image_format,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error);
|
||||
|
||||
AaruConsole.ErrorWriteLine(UI.Unable_to_open_image_format);
|
||||
@@ -793,7 +800,9 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Exception_reading_file, ButtonEnum.Ok,
|
||||
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||
UI.Exception_reading_file,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error);
|
||||
|
||||
AaruConsole.ErrorWriteLine(string.Format(UI.Error_reading_file_0, ex.Message));
|
||||
@@ -809,22 +818,24 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
void RefreshDevices()
|
||||
{
|
||||
if(!DevicesSupported)
|
||||
return;
|
||||
if(!DevicesSupported) return;
|
||||
|
||||
try
|
||||
{
|
||||
AaruConsole.WriteLine(UI.Refreshing_devices);
|
||||
_devicesRoot.Devices.Clear();
|
||||
|
||||
foreach(Devices.DeviceInfo device in Device.ListDevices().
|
||||
Where(d => d.Supported).
|
||||
OrderBy(d => d.Vendor).
|
||||
ThenBy(d => d.Model))
|
||||
foreach(Devices.DeviceInfo device in Device.ListDevices()
|
||||
.Where(d => d.Supported)
|
||||
.OrderBy(d => d.Vendor)
|
||||
.ThenBy(d => d.Model))
|
||||
{
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
UI.Found_supported_device_model_0_by_manufacturer_1_on_bus_2_and_path_3,
|
||||
device.Model, device.Vendor, device.Bus, device.Path);
|
||||
device.Model,
|
||||
device.Vendor,
|
||||
device.Bus,
|
||||
device.Path);
|
||||
|
||||
var deviceModel = new DeviceModel
|
||||
{
|
||||
@@ -839,8 +850,10 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
if(dev is Devices.Remote.Device remoteDev)
|
||||
{
|
||||
Statistics.AddRemote(remoteDev.RemoteApplication, remoteDev.RemoteVersion,
|
||||
remoteDev.RemoteOperatingSystem, remoteDev.RemoteOperatingSystemVersion,
|
||||
Statistics.AddRemote(remoteDev.RemoteApplication,
|
||||
remoteDev.RemoteVersion,
|
||||
remoteDev.RemoteOperatingSystem,
|
||||
remoteDev.RemoteOperatingSystemVersion,
|
||||
remoteDev.RemoteArchitecture);
|
||||
}
|
||||
|
||||
|
||||
@@ -172,8 +172,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
|
||||
foreach(IWritableImage plugin in plugins.WritableImages.Values)
|
||||
{
|
||||
if(plugin is null)
|
||||
continue;
|
||||
if(plugin is null) continue;
|
||||
|
||||
if(plugin.SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
@@ -184,15 +183,15 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
Encodings.AddRange(Encoding.GetEncodings().
|
||||
Select(info => new EncodingModel
|
||||
Encodings.AddRange(Encoding.GetEncodings()
|
||||
.Select(info => new EncodingModel
|
||||
{
|
||||
Name = info.Name,
|
||||
DisplayName = info.GetEncoding().EncodingName
|
||||
}));
|
||||
|
||||
Encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings().
|
||||
Select(info => new EncodingModel
|
||||
Encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings()
|
||||
.Select(info => new EncodingModel
|
||||
{
|
||||
Name = info.Name,
|
||||
DisplayName = info.DisplayName
|
||||
@@ -452,11 +451,9 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
{
|
||||
this.RaiseAndSetIfChanged(ref _useResume, value);
|
||||
|
||||
if(!value)
|
||||
return;
|
||||
if(!value) return;
|
||||
|
||||
if(_outputPrefix != null)
|
||||
CheckResumeFile().GetAwaiter().GetResult();
|
||||
if(_outputPrefix != null) CheckResumeFile().GetAwaiter().GetResult();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,8 +539,8 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
var fs = new FileStream(result[0], FileMode.Open);
|
||||
|
||||
_sidecar =
|
||||
(JsonSerializer.Deserialize(fs, typeof(MetadataJson), MetadataJsonContext.Default) as MetadataJson)?
|
||||
.AaruMetadata;
|
||||
(JsonSerializer.Deserialize(fs, typeof(MetadataJson), MetadataJsonContext.Default) as MetadataJson)
|
||||
?.AaruMetadata;
|
||||
|
||||
fs.Close();
|
||||
}
|
||||
@@ -553,10 +550,9 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
_ = MessageBoxManager.
|
||||
|
||||
// ReSharper restore AssignmentIsFullyDiscarded
|
||||
GetMessageBoxStandard(UI.Title_Error, UI.Incorrect_metadata_sidecar_file, ButtonEnum.Ok,
|
||||
Icon.Error).
|
||||
ShowWindowDialogAsync(_view).
|
||||
Result;
|
||||
GetMessageBoxStandard(UI.Title_Error, UI.Incorrect_metadata_sidecar_file, ButtonEnum.Ok, Icon.Error)
|
||||
.ShowWindowDialogAsync(_view)
|
||||
.Result;
|
||||
|
||||
ExistingMetadata = false;
|
||||
}
|
||||
@@ -673,8 +669,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
|
||||
async Task ExecuteDestinationCommand()
|
||||
{
|
||||
if(SelectedPlugin is null)
|
||||
return;
|
||||
if(SelectedPlugin is null) return;
|
||||
|
||||
var dlgDestination = new SaveFileDialog
|
||||
{
|
||||
@@ -697,8 +692,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
return;
|
||||
}
|
||||
|
||||
if(string.IsNullOrEmpty(Path.GetExtension(result)))
|
||||
result += SelectedPlugin.Plugin.KnownExtensions.First();
|
||||
if(string.IsNullOrEmpty(Path.GetExtension(result))) result += SelectedPlugin.Plugin.KnownExtensions.First();
|
||||
|
||||
Destination = result;
|
||||
|
||||
@@ -728,26 +722,28 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
else if(File.Exists(_outputPrefix + ".resume.xml"))
|
||||
{
|
||||
// Should be covered by virtue of being the same exact class as the JSON above
|
||||
#pragma warning disable IL2026
|
||||
#pragma warning disable IL2026
|
||||
var xs = new XmlSerializer(typeof(Resume));
|
||||
#pragma warning restore IL2026
|
||||
#pragma warning restore IL2026
|
||||
|
||||
var sr = new StreamReader(_outputPrefix + ".resume.xml");
|
||||
|
||||
// Should be covered by virtue of being the same exact class as the JSON above
|
||||
#pragma warning disable IL2026
|
||||
#pragma warning disable IL2026
|
||||
_resume = (Resume)xs.Deserialize(sr);
|
||||
#pragma warning restore IL2026
|
||||
#pragma warning restore IL2026
|
||||
|
||||
sr.Close();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
await MessageBoxManager.
|
||||
GetMessageBoxStandard(UI.Title_Error, UI.Incorrect_resume_file_cannot_use_it, ButtonEnum.Ok,
|
||||
Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
await MessageBoxManager
|
||||
.GetMessageBoxStandard(UI.Title_Error,
|
||||
UI.Incorrect_resume_file_cannot_use_it,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
Resume = false;
|
||||
|
||||
@@ -757,11 +753,12 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
if(_resume == null || _resume.NextBlock <= _resume.LastBlock || _resume.BadBlocks.Count != 0 && !_resume.Tape)
|
||||
return;
|
||||
|
||||
await MessageBoxManager.
|
||||
GetMessageBoxStandard(UI.Title_Warning,
|
||||
UI.Media_already_dumped_correctly_please_choose_another_destination, ButtonEnum.Ok,
|
||||
Icon.Warning).
|
||||
ShowWindowDialogAsync(_view);
|
||||
await MessageBoxManager
|
||||
.GetMessageBoxStandard(UI.Title_Warning,
|
||||
UI.Media_already_dumped_correctly_please_choose_another_destination,
|
||||
ButtonEnum.Ok,
|
||||
Icon.Warning)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
Resume = false;
|
||||
}
|
||||
@@ -796,8 +793,10 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
|
||||
return;
|
||||
case Devices.Remote.Device remoteDev:
|
||||
Statistics.AddRemote(remoteDev.RemoteApplication, remoteDev.RemoteVersion,
|
||||
remoteDev.RemoteOperatingSystem, remoteDev.RemoteOperatingSystemVersion,
|
||||
Statistics.AddRemote(remoteDev.RemoteApplication,
|
||||
remoteDev.RemoteVersion,
|
||||
remoteDev.RemoteOperatingSystem,
|
||||
remoteDev.RemoteOperatingSystemVersion,
|
||||
remoteDev.RemoteArchitecture);
|
||||
|
||||
break;
|
||||
@@ -873,11 +872,45 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
|
||||
var errorLog = new ErrorLog(_outputPrefix + ".error.log");
|
||||
|
||||
_dumper = new Dump(Resume, _dev, _devicePath, SelectedPlugin.Plugin, (ushort)Retries, Force, false, Persistent,
|
||||
StopOnError, _resume, dumpLog, encoding, _outputPrefix, Destination, parsedOptions, _sidecar,
|
||||
(uint)Skipped, ExistingMetadata == false, Trim == false, Track1Pregap, true, false,
|
||||
DumpSubchannel.Any, 0, false, false, false, false, false, true, errorLog, false, 64, true,
|
||||
true, false, 10, true, 1080);
|
||||
_dumper = new Dump(Resume,
|
||||
_dev,
|
||||
_devicePath,
|
||||
SelectedPlugin.Plugin,
|
||||
(ushort)Retries,
|
||||
Force,
|
||||
false,
|
||||
Persistent,
|
||||
StopOnError,
|
||||
_resume,
|
||||
dumpLog,
|
||||
encoding,
|
||||
_outputPrefix,
|
||||
Destination,
|
||||
parsedOptions,
|
||||
_sidecar,
|
||||
(uint)Skipped,
|
||||
ExistingMetadata == false,
|
||||
Trim == false,
|
||||
Track1Pregap,
|
||||
true,
|
||||
false,
|
||||
DumpSubchannel.Any,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
errorLog,
|
||||
false,
|
||||
64,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
10,
|
||||
true,
|
||||
1080);
|
||||
|
||||
new Thread(DoWork).Start();
|
||||
}
|
||||
@@ -955,8 +988,8 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
{
|
||||
ErrorMessage(text);
|
||||
|
||||
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, $"{text}", ButtonEnum.Ok, Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, $"{text}", ButtonEnum.Ok, Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
await WorkFinished();
|
||||
});
|
||||
|
||||
@@ -109,6 +109,7 @@ public sealed class MediaScanViewModel : ViewModelBase
|
||||
StartVisible = true;
|
||||
CloseVisible = true;
|
||||
BlockMapList = new ObservableCollection<(ulong block, double duration)>();
|
||||
|
||||
// ChartPoints = new ObservableCollection<DataPoint>();
|
||||
StepsX = double.NaN;
|
||||
StepsY = double.NaN;
|
||||
@@ -136,6 +137,7 @@ public sealed class MediaScanViewModel : ViewModelBase
|
||||
}
|
||||
|
||||
public ObservableCollection<(ulong block, double duration)> BlockMapList { get; }
|
||||
|
||||
// public ObservableCollection<DataPoint> ChartPoints { get; }
|
||||
|
||||
public ulong Blocks
|
||||
@@ -329,6 +331,7 @@ public sealed class MediaScanViewModel : ViewModelBase
|
||||
CloseVisible = false;
|
||||
ProgressVisible = true;
|
||||
ResultsVisible = true;
|
||||
|
||||
// ChartPoints.Clear();
|
||||
new Thread(DoWork).Start();
|
||||
}
|
||||
@@ -345,10 +348,12 @@ public sealed class MediaScanViewModel : ViewModelBase
|
||||
switch(dev)
|
||||
{
|
||||
case null:
|
||||
await MessageBoxManager.
|
||||
GetMessageBoxStandard(UI.Title_Error, string.Format(UI.Error_0_opening_device, devErrno),
|
||||
ButtonEnum.Ok, Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
await MessageBoxManager
|
||||
.GetMessageBoxStandard(UI.Title_Error,
|
||||
string.Format(UI.Error_0_opening_device, devErrno),
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
StopVisible = false;
|
||||
StartVisible = true;
|
||||
@@ -357,8 +362,10 @@ public sealed class MediaScanViewModel : ViewModelBase
|
||||
|
||||
return;
|
||||
case Devices.Remote.Device remoteDev:
|
||||
Statistics.AddRemote(remoteDev.RemoteApplication, remoteDev.RemoteVersion,
|
||||
remoteDev.RemoteOperatingSystem, remoteDev.RemoteOperatingSystemVersion,
|
||||
Statistics.AddRemote(remoteDev.RemoteApplication,
|
||||
remoteDev.RemoteVersion,
|
||||
remoteDev.RemoteOperatingSystem,
|
||||
remoteDev.RemoteOperatingSystemVersion,
|
||||
remoteDev.RemoteArchitecture);
|
||||
|
||||
break;
|
||||
@@ -366,10 +373,12 @@ public sealed class MediaScanViewModel : ViewModelBase
|
||||
|
||||
if(dev.Error)
|
||||
{
|
||||
await MessageBoxManager.
|
||||
GetMessageBoxStandard(UI.Title_Error, string.Format(UI.Error_0_opening_device, dev.LastError),
|
||||
ButtonEnum.Ok, Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
await MessageBoxManager
|
||||
.GetMessageBoxStandard(UI.Title_Error,
|
||||
string.Format(UI.Error_0_opening_device, dev.LastError),
|
||||
ButtonEnum.Ok,
|
||||
Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
StopVisible = false;
|
||||
StartVisible = true;
|
||||
@@ -454,8 +463,7 @@ public sealed class MediaScanViewModel : ViewModelBase
|
||||
ChartPoints.Add(new DataPoint(sector, currentSpeed));
|
||||
*/
|
||||
|
||||
if(currentSpeed > MaxY)
|
||||
MaxY = currentSpeed + currentSpeed / 10d;
|
||||
if(currentSpeed > MaxY) MaxY = currentSpeed + currentSpeed / 10d;
|
||||
});
|
||||
|
||||
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||
@@ -599,8 +607,8 @@ public sealed class MediaScanViewModel : ViewModelBase
|
||||
{
|
||||
ProgressText = text;
|
||||
|
||||
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, $"{text}", ButtonEnum.Ok, Icon.Error).
|
||||
ShowWindowDialogAsync(_view);
|
||||
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, $"{text}", ButtonEnum.Ok, Icon.Error)
|
||||
.ShowWindowDialogAsync(_view);
|
||||
|
||||
await WorkFinished();
|
||||
});
|
||||
|
||||
@@ -143,38 +143,38 @@ public sealed class SplashWindowViewModel(SplashWindow view) : ViewModelBase
|
||||
ctx = AaruContext.Create(Settings.Settings.LocalDbPath);
|
||||
ctx.Database.EnsureCreated();
|
||||
|
||||
ctx.Database.
|
||||
ExecuteSqlRaw("CREATE TABLE IF NOT EXISTS \"__EFMigrationsHistory\" (\"MigrationId\" TEXT PRIMARY KEY, \"ProductVersion\" TEXT)");
|
||||
ctx.Database
|
||||
.ExecuteSqlRaw("CREATE TABLE IF NOT EXISTS \"__EFMigrationsHistory\" (\"MigrationId\" TEXT PRIMARY KEY, \"ProductVersion\" TEXT)");
|
||||
|
||||
foreach(string migration in ctx.Database.GetPendingMigrations())
|
||||
{
|
||||
ctx.Database.
|
||||
ExecuteSqlRaw($"INSERT INTO \"__EFMigrationsHistory\" (MigrationId, ProductVersion) VALUES ('{
|
||||
migration}', '0.0.0')");
|
||||
ctx.Database
|
||||
.ExecuteSqlRaw($"INSERT INTO \"__EFMigrationsHistory\" (MigrationId, ProductVersion) VALUES ('{
|
||||
migration}', '0.0.0')");
|
||||
}
|
||||
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
||||
// Remove duplicates
|
||||
foreach(var duplicate in ctx.SeenDevices.AsEnumerable().
|
||||
GroupBy(a => new
|
||||
foreach(var duplicate in ctx.SeenDevices.AsEnumerable()
|
||||
.GroupBy(a => new
|
||||
{
|
||||
a.Manufacturer,
|
||||
a.Model,
|
||||
a.Revision,
|
||||
a.Bus
|
||||
}).
|
||||
Where(a => a.Count() > 1).
|
||||
Distinct().
|
||||
Select(a => a.Key))
|
||||
})
|
||||
.Where(a => a.Count() > 1)
|
||||
.Distinct()
|
||||
.Select(a => a.Key))
|
||||
{
|
||||
ctx.RemoveRange(ctx.SeenDevices.
|
||||
Where(d => d.Manufacturer == duplicate.Manufacturer &&
|
||||
ctx.RemoveRange(ctx.SeenDevices
|
||||
.Where(d => d.Manufacturer == duplicate.Manufacturer &&
|
||||
d.Model == duplicate.Model &&
|
||||
d.Revision == duplicate.Revision &&
|
||||
d.Bus == duplicate.Bus).
|
||||
Skip(1));
|
||||
d.Bus == duplicate.Bus)
|
||||
.Skip(1));
|
||||
}
|
||||
|
||||
// Remove nulls
|
||||
|
||||
@@ -85,8 +85,7 @@ public sealed class ViewSectorViewModel : ViewModelBase
|
||||
? _inputFormat.ReadSectorLong((ulong)SectorNumber, out byte[] sector)
|
||||
: _inputFormat.ReadSector((ulong)SectorNumber, out sector);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
PrintHexText = PrintHex.ByteArrayToHexArrayString(sector, HEX_COLUMNS);
|
||||
if(errno == ErrorNumber.NoError) PrintHexText = PrintHex.ByteArrayToHexArrayString(sector, HEX_COLUMNS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user