[Refactor] Use collection expressions.

This commit is contained in:
2024-05-01 04:39:38 +01:00
parent f7ca79b09e
commit 134ce7041e
667 changed files with 12936 additions and 13750 deletions

View File

@@ -63,7 +63,7 @@ public sealed class AboutViewModel : ViewModelBase
LicenseCommand = ReactiveCommand.Create(ExecuteLicenseCommand);
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
Assemblies = new ObservableCollection<AssemblyModel>();
Assemblies = [];
Task.Run(() =>
{

View File

@@ -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
});

View File

@@ -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(() =>

View File

@@ -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

View File

@@ -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);