mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Refactor] Use collection expressions.
This commit is contained in:
@@ -63,7 +63,7 @@ public sealed class AboutViewModel : ViewModelBase
|
||||
LicenseCommand = ReactiveCommand.Create(ExecuteLicenseCommand);
|
||||
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
|
||||
|
||||
Assemblies = new ObservableCollection<AssemblyModel>();
|
||||
Assemblies = [];
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
@@ -99,10 +98,13 @@ public sealed class ConsoleViewModel : ViewModelBase
|
||||
|
||||
dlgSave.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"log"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"log"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Log_files
|
||||
});
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public sealed class EncodingsViewModel : ViewModelBase
|
||||
public EncodingsViewModel(Encodings view)
|
||||
{
|
||||
_view = view;
|
||||
Encodings = new ObservableCollection<EncodingModel>();
|
||||
Encodings = [];
|
||||
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
|
||||
|
||||
Task.Run(() =>
|
||||
|
||||
@@ -50,14 +50,14 @@ public sealed class PluginsViewModel : ViewModelBase
|
||||
public PluginsViewModel(PluginsDialog view)
|
||||
{
|
||||
_view = view;
|
||||
Filters = new ObservableCollection<PluginModel>();
|
||||
PartitionSchemes = new ObservableCollection<PluginModel>();
|
||||
Filesystems = new ObservableCollection<PluginModel>();
|
||||
ReadOnlyFilesystems = new ObservableCollection<PluginModel>();
|
||||
Images = new ObservableCollection<PluginModel>();
|
||||
WritableImages = new ObservableCollection<PluginModel>();
|
||||
FloppyImages = new ObservableCollection<PluginModel>();
|
||||
WritableFloppyImages = new ObservableCollection<PluginModel>();
|
||||
Filters = [];
|
||||
PartitionSchemes = [];
|
||||
Filesystems = [];
|
||||
ReadOnlyFilesystems = [];
|
||||
Images = [];
|
||||
WritableImages = [];
|
||||
FloppyImages = [];
|
||||
WritableFloppyImages = [];
|
||||
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
|
||||
|
||||
// TODO: Takes too much time
|
||||
|
||||
@@ -90,12 +90,12 @@ public sealed class StatisticsViewModel : ViewModelBase
|
||||
public StatisticsViewModel(StatisticsDialog view)
|
||||
{
|
||||
_view = view;
|
||||
Filters = new ObservableCollection<NameCountModel>();
|
||||
Formats = new ObservableCollection<NameCountModel>();
|
||||
Partitions = new ObservableCollection<NameCountModel>();
|
||||
Filesystems = new ObservableCollection<NameCountModel>();
|
||||
Devices = new ObservableCollection<DeviceStatsModel>();
|
||||
Medias = new ObservableCollection<MediaStatsModel>();
|
||||
Filters = [];
|
||||
Formats = [];
|
||||
Partitions = [];
|
||||
Filesystems = [];
|
||||
Devices = [];
|
||||
Medias = [];
|
||||
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
|
||||
using var ctx = AaruContext.Create(Settings.Settings.LocalDbPath);
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
@@ -1023,10 +1022,13 @@ public sealed class DeviceInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
|
||||
@@ -81,11 +81,11 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
_imagePath = imagePath;
|
||||
_filter = filter;
|
||||
_imageFormat = imageFormat;
|
||||
MediaTagsList = new ObservableCollection<string>();
|
||||
SectorTagsList = new ObservableCollection<string>();
|
||||
Sessions = new ObservableCollection<Session>();
|
||||
Tracks = new ObservableCollection<Track>();
|
||||
DumpHardwareList = new ObservableCollection<DumpHardwareModel>();
|
||||
MediaTagsList = [];
|
||||
SectorTagsList = [];
|
||||
Sessions = [];
|
||||
Tracks = [];
|
||||
DumpHardwareList = [];
|
||||
EntropyCommand = ReactiveCommand.Create(ExecuteEntropyCommand);
|
||||
VerifyCommand = ReactiveCommand.Create(ExecuteVerifyCommand);
|
||||
ChecksumCommand = ReactiveCommand.Create(ExecuteChecksumCommand);
|
||||
@@ -694,9 +694,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
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
|
||||
{
|
||||
@@ -706,9 +705,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
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
|
||||
{
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Text;
|
||||
@@ -393,10 +392,13 @@ public sealed class MediaInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ public sealed class SubdirectoryViewModel
|
||||
|
||||
public SubdirectoryViewModel([NotNull] SubdirectoryModel model, Window view)
|
||||
{
|
||||
Entries = new ObservableCollection<FileModel>();
|
||||
SelectedEntries = new List<FileModel>();
|
||||
Entries = [];
|
||||
SelectedEntries = [];
|
||||
ExtractFilesCommand = ReactiveCommand.Create(ExecuteExtractFilesCommand);
|
||||
_model = model;
|
||||
_view = view;
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
@@ -117,10 +116,13 @@ public sealed class AtaInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -143,10 +145,13 @@ public sealed class AtaInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveText.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.txt"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.txt"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Text_files
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
@@ -179,10 +178,13 @@ public sealed class BlurayInfoViewModel
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
_pmaData = pma;
|
||||
_cdTextLeadInData = cdTextLeadIn;
|
||||
_view = view;
|
||||
IsrcList = new ObservableCollection<IsrcModel>();
|
||||
IsrcList = [];
|
||||
SaveCdInformationCommand = ReactiveCommand.Create(ExecuteSaveCdInformationCommand);
|
||||
SaveCdTocCommand = ReactiveCommand.Create(ExecuteSaveCdTocCommand);
|
||||
SaveCdFullTocCommand = ReactiveCommand.Create(ExecuteSaveCdFullTocCommand);
|
||||
@@ -153,10 +153,13 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -176,10 +179,13 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -199,10 +205,13 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -222,10 +231,13 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -245,10 +257,13 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -268,10 +283,13 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -291,10 +309,13 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
@@ -129,10 +128,13 @@ public sealed class DvdInfoViewModel
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
@@ -255,10 +254,13 @@ public sealed class DvdWritableInfoViewModel
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
@@ -58,7 +57,7 @@ public class PcmciaInfoViewModel : ViewModelBase
|
||||
if(pcmciaCis == null) return;
|
||||
|
||||
_cis = pcmciaCis;
|
||||
CisList = new ObservableCollection<PcmciaCisModel>();
|
||||
CisList = [];
|
||||
SavePcmciaCisCommand = ReactiveCommand.Create(ExecuteSavePcmciaCisCommand);
|
||||
|
||||
_view = view;
|
||||
@@ -180,10 +179,13 @@ public class PcmciaInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
|
||||
@@ -72,9 +72,9 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
_scsiModeSense10 = scsiModeSense10;
|
||||
_configuration = mmcConfiguration;
|
||||
_view = view;
|
||||
ModeSensePages = new ObservableCollection<ScsiPageModel>();
|
||||
EvpdPages = new ObservableCollection<ScsiPageModel>();
|
||||
MmcFeatures = new ObservableCollection<ScsiPageModel>();
|
||||
ModeSensePages = [];
|
||||
EvpdPages = [];
|
||||
MmcFeatures = [];
|
||||
SaveInquiryBinaryCommand = ReactiveCommand.Create(ExecuteSaveInquiryBinaryCommand);
|
||||
SaveInquiryTextCommand = ReactiveCommand.Create(ExecuteSaveInquiryTextCommand);
|
||||
SaveModeSense6Command = ReactiveCommand.Create(ExecuteSaveModeSense6Command);
|
||||
@@ -805,10 +805,13 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -828,10 +831,13 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveText.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.txt"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.txt"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Text_files
|
||||
});
|
||||
|
||||
@@ -851,10 +857,13 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -874,10 +883,13 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -899,10 +911,13 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
@@ -922,10 +937,13 @@ public sealed class ScsiInfoViewModel : ViewModelBase
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2024 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
@@ -106,10 +105,13 @@ public sealed class XboxInfoViewModel
|
||||
|
||||
dlgSaveBinary.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.bin"
|
||||
}
|
||||
],
|
||||
Name = UI.Dialog_Binary_files
|
||||
});
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public sealed class DecodeMediaTagsViewModel : ViewModelBase
|
||||
|
||||
public DecodeMediaTagsViewModel([NotNull] IMediaImage inputFormat)
|
||||
{
|
||||
TagsList = new ObservableCollection<MediaTagModel>();
|
||||
TagsList = [];
|
||||
|
||||
_mediaType = inputFormat.Info.MediaType;
|
||||
|
||||
|
||||
@@ -107,8 +107,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
Md5Checked = true;
|
||||
Sha1Checked = true;
|
||||
SpamsumChecked = true;
|
||||
TrackChecksums = new ObservableCollection<ChecksumModel>();
|
||||
MediaChecksums = new ObservableCollection<ChecksumModel>();
|
||||
TrackChecksums = [];
|
||||
MediaChecksums = [];
|
||||
StartCommand = ReactiveCommand.Create(ExecuteStartCommand);
|
||||
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
|
||||
StopCommand = ReactiveCommand.Create(ExecuteStopCommand);
|
||||
|
||||
@@ -1145,7 +1145,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
Dictionary<byte, string> isrcs = new();
|
||||
Dictionary<byte, byte> trackFlags = new();
|
||||
string mcn = null;
|
||||
HashSet<int> subchannelExtents = new();
|
||||
HashSet<int> subchannelExtents = [];
|
||||
Dictionary<byte, int> smallestPregapLbaPerTrack = new();
|
||||
|
||||
foreach(SectorTagType tag in _inputFormat.Info.ReadableSectorTags.Where(t => t == SectorTagType.CdTrackIsrc)
|
||||
@@ -1436,12 +1436,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
{
|
||||
foreach(KeyValuePair<byte, byte> flags in trackFlags)
|
||||
{
|
||||
outputOptical.WriteSectorTag(new[]
|
||||
{
|
||||
flags.Value
|
||||
},
|
||||
flags.Key,
|
||||
SectorTagType.CdTrackFlags);
|
||||
outputOptical.WriteSectorTag([flags.Value], flags.Key, SectorTagType.CdTrackFlags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2130,10 +2125,13 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
dlgMetadata.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Name = UI.Dialog_Aaru_Metadata,
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
".json"
|
||||
})
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
".json"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
string[] result = await dlgMetadata.ShowAsync(_view);
|
||||
@@ -2178,10 +2176,13 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
dlgMetadata.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Name = UI.Dialog_Choose_existing_resume_file,
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
".json"
|
||||
})
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
".json"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
string[] result = await dlgMetadata.ShowAsync(_view);
|
||||
|
||||
@@ -86,7 +86,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
||||
{
|
||||
_inputFormat = inputFormat;
|
||||
_view = view;
|
||||
TrackEntropy = new ObservableCollection<TrackEntropyModel>();
|
||||
TrackEntropy = [];
|
||||
StartCommand = ReactiveCommand.Create(ExecuteStartCommand);
|
||||
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
|
||||
StopCommand = ReactiveCommand.Create(ExecuteStopCommand);
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
@@ -331,10 +330,13 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
||||
dlgDestination.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Name = UI.Dialog_Aaru_Metadata,
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.json"
|
||||
})
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
"*.json"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
string result = await dlgDestination.ShowAsync(_view);
|
||||
|
||||
@@ -100,8 +100,8 @@ public sealed class ImageVerifyViewModel : ViewModelBase
|
||||
StopCommand = ReactiveCommand.Create(ExecuteStopCommand);
|
||||
_inputFormat = inputFormat;
|
||||
_cancel = false;
|
||||
ErrorList = new ObservableCollection<LbaModel>();
|
||||
UnknownList = new ObservableCollection<LbaModel>();
|
||||
ErrorList = [];
|
||||
UnknownList = [];
|
||||
VerifyImageEnabled = true;
|
||||
VerifySectorsEnabled = true;
|
||||
CloseVisible = true;
|
||||
@@ -447,8 +447,8 @@ public sealed class ImageVerifyViewModel : ViewModelBase
|
||||
if(VerifySectorsChecked)
|
||||
{
|
||||
var chkStopwatch = new Stopwatch();
|
||||
List<ulong> failingLbas = new();
|
||||
List<ulong> unknownLbas = new();
|
||||
List<ulong> failingLbas = [];
|
||||
List<ulong> unknownLbas = [];
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
|
||||
@@ -108,7 +108,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
DecodeImageMediaTagsCommand = ReactiveCommand.Create(ExecuteDecodeImageMediaTagsCommand);
|
||||
RefreshDevicesCommand = ReactiveCommand.Create(ExecuteRefreshDevicesCommand);
|
||||
_view = view;
|
||||
TreeRoot = new ObservableCollection<RootModel>();
|
||||
TreeRoot = [];
|
||||
ContentPanel = Greeting;
|
||||
|
||||
_imagesRoot = new ImagesRootModel
|
||||
|
||||
@@ -125,8 +125,8 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
|
||||
StopCommand = ReactiveCommand.Create(ExecuteStopCommand);
|
||||
DestinationCommand = ReactiveCommand.Create(ExecuteDestinationCommand);
|
||||
PluginsList = new ObservableCollection<ImagePluginModel>();
|
||||
Encodings = new ObservableCollection<EncodingModel>();
|
||||
PluginsList = [];
|
||||
Encodings = [];
|
||||
|
||||
// Defaults
|
||||
StopOnError = false;
|
||||
@@ -519,10 +519,13 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
dlgMetadata.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Name = UI.Dialog_Aaru_Metadata,
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
".json"
|
||||
})
|
||||
Extensions =
|
||||
[
|
||||
..new[]
|
||||
{
|
||||
".json"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
string[] result = dlgMetadata.ShowAsync(_view).Result;
|
||||
|
||||
@@ -108,7 +108,7 @@ public sealed class MediaScanViewModel : ViewModelBase
|
||||
StopCommand = ReactiveCommand.Create(ExecuteStopCommand);
|
||||
StartVisible = true;
|
||||
CloseVisible = true;
|
||||
BlockMapList = new ObservableCollection<(ulong block, double duration)>();
|
||||
BlockMapList = [];
|
||||
|
||||
// ChartPoints = new ObservableCollection<DataPoint>();
|
||||
StepsX = double.NaN;
|
||||
|
||||
Reference in New Issue
Block a user