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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user