From d29afd403ac805bb020334920eb9d0889abe95a7 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 24 Nov 2025 03:08:01 +0000 Subject: [PATCH] [Refactor] Use collection expression. --- Aaru.CommonTypes/Interop/Version.cs | 6 +- Aaru.Compression/LzdStream.cs | 8 +-- Aaru.Filesystems/AppleDOS/AppleDOS.cs | 17 +++-- Aaru.Filesystems/AppleDOS/File.cs | 24 ++----- Aaru.Filesystems/AppleDOS/Xattr.cs | 12 +--- Aaru.Filesystems/AppleMFS/AppleMFS.cs | 17 +++-- Aaru.Filesystems/AppleMFS/File.cs | 18 +---- Aaru.Filesystems/AppleMFS/Xattr.cs | 12 +--- Aaru.Filesystems/CBM/CBM.cs | 35 +++++----- Aaru.Filesystems/CBM/File.cs | 18 +---- Aaru.Filesystems/CPM/CPM.cs | 3 +- Aaru.Filesystems/CPM/File.cs | 18 +---- Aaru.Filesystems/CPM/Xattr.cs | 17 ++--- Aaru.Filesystems/FAT/Dir.cs | 6 +- Aaru.Filesystems/FAT/FAT.cs | 17 +++-- Aaru.Filesystems/FAT/File.cs | 6 +- Aaru.Filesystems/FATX/Dir.cs | 6 +- Aaru.Filesystems/FATX/FATX.cs | 17 +++-- Aaru.Filesystems/FATX/File.cs | 6 +- Aaru.Filesystems/ISO9660/Dir.cs | 12 +--- Aaru.Filesystems/ISO9660/File.cs | 6 +- Aaru.Filesystems/ISO9660/ISO9660.cs | 13 ++-- Aaru.Filesystems/LisaFS/File.cs | 16 ++--- Aaru.Filesystems/LisaFS/LisaFS.cs | 17 +++-- Aaru.Filesystems/Opera/Dir.cs | 6 +- Aaru.Filesystems/Opera/File.cs | 6 +- Aaru.Filesystems/Opera/Opera.cs | 17 +++-- Aaru.Filesystems/UCSDPascal/File.cs | 18 +---- Aaru.Filesystems/UCSDPascal/UCSDPascal.cs | 17 +++-- Aaru.Gui/Controls/HexViewPanel.cs | 7 +- .../ViewModels/Windows/MediaScanViewModel.cs | 2 +- Aaru.Images/A2R/Properties.cs | 16 ++--- Aaru.Images/Alcohol120/Properties.cs | 57 ++++++++-------- Aaru.Images/Anex86/Properties.cs | 25 ++++--- Aaru.Images/Apple2MG/Properties.cs | 18 ++--- Aaru.Images/AppleDOS/Properties.cs | 17 ++--- Aaru.Images/Apridisk/Properties.cs | 33 +++++----- Aaru.Images/BLU/Properties.cs | 21 ++---- Aaru.Images/BlindWrite4/Read.cs | 66 +++++++------------ Aaru.Images/ByteAddressable/AtariLynx.cs | 17 ++--- Aaru.Images/ByteAddressable/GameBoy.cs | 17 ++--- Aaru.Images/ByteAddressable/GameBoyAdvance.cs | 17 ++--- Aaru.Images/ByteAddressable/MasterSystem.cs | 17 ++--- Aaru.Images/ByteAddressable/NES.cs | 17 ++--- Aaru.Images/ByteAddressable/Nintendo64.cs | 17 ++--- Aaru.Images/ByteAddressable/SegaMegaDrive.cs | 18 ++--- Aaru.Images/ByteAddressable/SuperNintendo.cs | 17 ++--- Aaru.Images/CDRDAO/Properties.cs | 51 +++++++------- Aaru.Images/CDRDAO/Write.cs | 11 ++-- Aaru.Images/CDRWin/Properties.cs | 64 ++++++++---------- Aaru.Images/CDRWin/Write.cs | 11 ++-- Aaru.Images/CisCopy/Properties.cs | 18 ++--- Aaru.Images/CloneCD/Properties.cs | 45 ++++++------- Aaru.Images/CloneCD/Read.cs | 6 +- Aaru.Images/CopyTape/CopyTape.cs | 6 +- Aaru.Images/CopyTape/Properties.cs | 63 +++++++++--------- Aaru.Images/DiskCopy42/Properties.cs | 26 +++----- Aaru.Images/DriDiskCopy/Properties.cs | 28 ++++---- Aaru.Images/KryoFlux/Read.cs | 6 +- Aaru.Images/MaxiDisk/Properties.cs | 18 ++--- Aaru.Images/NHDr0/Properties.cs | 17 ++--- Aaru.Images/Parallels/Properties.cs | 18 ++--- Aaru.Images/QCOW/Properties.cs | 18 ++--- Aaru.Images/QCOW2/Properties.cs | 18 ++--- Aaru.Images/QED/Properties.cs | 18 ++--- Aaru.Images/RayDIM/Properties.cs | 18 ++--- Aaru.Images/RsIde/Properties.cs | 21 ++---- Aaru.Images/SaveDskF/Properties.cs | 28 ++++---- Aaru.Images/SuperCardPro/Properties.cs | 16 ++--- Aaru.Images/T98/Properties.cs | 18 ++--- Aaru.Images/UDIF/Properties.cs | 18 ++--- Aaru.Images/VDI/Properties.cs | 18 ++--- Aaru.Images/VHD/Properties.cs | 23 +++---- Aaru.Images/VMware/Properties.cs | 23 +++---- Aaru.Images/Virtual98/Properties.cs | 18 ++--- Aaru.Images/ZZZRawImage/Properties.cs | 15 ++--- Aaru.Tests/Images/BlockMediaImageTest.cs | 2 +- Aaru.Tests/Images/OpticalMediaImageTest.cs | 2 +- .../WritableOpticalMediaImageTest.cs | 6 +- 79 files changed, 544 insertions(+), 914 deletions(-) diff --git a/Aaru.CommonTypes/Interop/Version.cs b/Aaru.CommonTypes/Interop/Version.cs index 50fe2f62a..962c377a7 100644 --- a/Aaru.CommonTypes/Interop/Version.cs +++ b/Aaru.CommonTypes/Interop/Version.cs @@ -62,11 +62,7 @@ public static class Version { Assembly assembly = typeof(GCSettings).Assembly; - string[] assemblyPath = assembly.CodeBase?.Split(new[] - { - '/', '\\' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] assemblyPath = assembly.CodeBase?.Split(['/', '\\'], StringSplitOptions.RemoveEmptyEntries); if(assemblyPath is null) return null; diff --git a/Aaru.Compression/LzdStream.cs b/Aaru.Compression/LzdStream.cs index ae6209514..6b556abb4 100644 --- a/Aaru.Compression/LzdStream.cs +++ b/Aaru.Compression/LzdStream.cs @@ -61,9 +61,9 @@ public partial class LzdStream : Stream if(buffer == null) throw new ArgumentNullException(nameof(buffer)); if(offset < 0 || count < 0 || offset + count > buffer.Length) throw new ArgumentOutOfRangeException(); - int totalRead = 0; - int totalOut = 0; - int iter = 0; + var totalRead = 0; + var totalOut = 0; + var iter = 0; while(totalRead < count) { @@ -115,7 +115,7 @@ public partial class LzdStream : Stream if(!_flushed) { Debug.WriteLine($"[FEED] size=0 flushed={_flushed} (final empty feed)"); - var f = (LZDStatus)LZD_FeedNative(_ctx, Array.Empty(), UIntPtr.Zero); + var f = (LZDStatus)LZD_FeedNative(_ctx, [], UIntPtr.Zero); if(f == LZDStatus.ERROR) ThrowDecoderError(); _flushed = true; Debug.WriteLine(">>> SET _flushed=true"); diff --git a/Aaru.Filesystems/AppleDOS/AppleDOS.cs b/Aaru.Filesystems/AppleDOS/AppleDOS.cs index d9739c1cb..4213a717b 100644 --- a/Aaru.Filesystems/AppleDOS/AppleDOS.cs +++ b/Aaru.Filesystems/AppleDOS/AppleDOS.cs @@ -53,6 +53,13 @@ public sealed partial class AppleDOS : IReadOnlyFilesystem uint _usedSectors; Vtoc _vtoc; + static Dictionary GetDefaultOptions() => new() + { + { + "debug", false.ToString() + } + }; + #region IReadOnlyFilesystem Members /// @@ -68,21 +75,13 @@ public sealed partial class AppleDOS : IReadOnlyFilesystem public string Author => Authors.NataliaPortillo; /// - public IEnumerable<(string name, Type type, string description)> SupportedOptions => - Array.Empty<(string name, Type type, string description)>(); + public IEnumerable<(string name, Type type, string description)> SupportedOptions => []; /// public Dictionary Namespaces => null; #endregion - static Dictionary GetDefaultOptions() => new() - { - { - "debug", false.ToString() - } - }; - #region Caches /// Caches track/sector lists diff --git a/Aaru.Filesystems/AppleDOS/File.cs b/Aaru.Filesystems/AppleDOS/File.cs index 9dea15fb7..6bd7de265 100644 --- a/Aaru.Filesystems/AppleDOS/File.cs +++ b/Aaru.Filesystems/AppleDOS/File.cs @@ -42,11 +42,7 @@ public sealed partial class AppleDOS { ErrorNumber CacheFile(string path) { - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -148,11 +144,7 @@ public sealed partial class AppleDOS if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -180,11 +172,7 @@ public sealed partial class AppleDOS if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -269,11 +257,7 @@ public sealed partial class AppleDOS if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; diff --git a/Aaru.Filesystems/AppleDOS/Xattr.cs b/Aaru.Filesystems/AppleDOS/Xattr.cs index db5eb9246..1952c6c95 100644 --- a/Aaru.Filesystems/AppleDOS/Xattr.cs +++ b/Aaru.Filesystems/AppleDOS/Xattr.cs @@ -47,11 +47,7 @@ public sealed partial class AppleDOS if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -82,11 +78,7 @@ public sealed partial class AppleDOS { if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; diff --git a/Aaru.Filesystems/AppleMFS/AppleMFS.cs b/Aaru.Filesystems/AppleMFS/AppleMFS.cs index bff49357a..be9a4eb4c 100644 --- a/Aaru.Filesystems/AppleMFS/AppleMFS.cs +++ b/Aaru.Filesystems/AppleMFS/AppleMFS.cs @@ -60,6 +60,13 @@ public sealed partial class AppleMFS : IReadOnlyFilesystem int _sectorsPerBlock; MasterDirectoryBlock _volMdb; + static Dictionary GetDefaultOptions() => new() + { + { + "debug", false.ToString() + } + }; + #region IReadOnlyFilesystem Members /// @@ -76,18 +83,10 @@ public sealed partial class AppleMFS : IReadOnlyFilesystem // TODO: Implement Finder namespace (requires decoding Desktop database) /// - public IEnumerable<(string name, Type type, string description)> SupportedOptions => - Array.Empty<(string name, Type type, string description)>(); + public IEnumerable<(string name, Type type, string description)> SupportedOptions => []; /// public Dictionary Namespaces => null; #endregion - - static Dictionary GetDefaultOptions() => new() - { - { - "debug", false.ToString() - } - }; } \ No newline at end of file diff --git a/Aaru.Filesystems/AppleMFS/File.cs b/Aaru.Filesystems/AppleMFS/File.cs index f688e3789..b8302b79a 100644 --- a/Aaru.Filesystems/AppleMFS/File.cs +++ b/Aaru.Filesystems/AppleMFS/File.cs @@ -46,11 +46,7 @@ public sealed partial class AppleMFS if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -157,11 +153,7 @@ public sealed partial class AppleMFS if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -292,11 +284,7 @@ public sealed partial class AppleMFS if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; diff --git a/Aaru.Filesystems/AppleMFS/Xattr.cs b/Aaru.Filesystems/AppleMFS/Xattr.cs index 5b3ff6c25..5a70bb547 100644 --- a/Aaru.Filesystems/AppleMFS/Xattr.cs +++ b/Aaru.Filesystems/AppleMFS/Xattr.cs @@ -50,11 +50,7 @@ public sealed partial class AppleMFS if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -103,11 +99,7 @@ public sealed partial class AppleMFS { if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; diff --git a/Aaru.Filesystems/CBM/CBM.cs b/Aaru.Filesystems/CBM/CBM.cs index 4b13da78b..804a54545 100644 --- a/Aaru.Filesystems/CBM/CBM.cs +++ b/Aaru.Filesystems/CBM/CBM.cs @@ -48,6 +48,22 @@ public sealed partial class CBM : IReadOnlyFilesystem byte[] _root; FileSystemInfo _statfs; + static Dictionary GetDefaultOptions() => new() + { + { + "debug", false.ToString() + } + }; + + ulong CbmChsToLba(byte track, byte sector, bool is1581) + { + if(track is 0 or > 40) return 0; + + if(is1581) return (ulong)((track - 1) * 40 + sector - 1); + + return trackStartingLbas[track - 1] + sector; + } + #region IReadOnlyFilesystem Members /// @@ -82,27 +98,10 @@ public sealed partial class CBM : IReadOnlyFilesystem public FileSystem Metadata { get; private set; } /// - public IEnumerable<(string name, Type type, string description)> SupportedOptions => - Array.Empty<(string name, Type type, string description)>(); + public IEnumerable<(string name, Type type, string description)> SupportedOptions => []; /// public Dictionary Namespaces => null; #endregion - - static Dictionary GetDefaultOptions() => new() - { - { - "debug", false.ToString() - } - }; - - ulong CbmChsToLba(byte track, byte sector, bool is1581) - { - if(track is 0 or > 40) return 0; - - if(is1581) return (ulong)((track - 1) * 40 + sector - 1); - - return trackStartingLbas[track - 1] + sector; - } } \ No newline at end of file diff --git a/Aaru.Filesystems/CBM/File.cs b/Aaru.Filesystems/CBM/File.cs index 147ce51b7..39fffb114 100644 --- a/Aaru.Filesystems/CBM/File.cs +++ b/Aaru.Filesystems/CBM/File.cs @@ -47,11 +47,7 @@ public sealed partial class CBM if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -71,11 +67,7 @@ public sealed partial class CBM if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -105,11 +97,7 @@ public sealed partial class CBM if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; diff --git a/Aaru.Filesystems/CPM/CPM.cs b/Aaru.Filesystems/CPM/CPM.cs index 9626a1727..a84bcb1b5 100644 --- a/Aaru.Filesystems/CPM/CPM.cs +++ b/Aaru.Filesystems/CPM/CPM.cs @@ -99,8 +99,7 @@ public sealed partial class CPM : IReadOnlyFilesystem public string Author => Authors.NataliaPortillo; /// - public IEnumerable<(string name, Type type, string description)> SupportedOptions => - Array.Empty<(string name, Type type, string description)>(); + public IEnumerable<(string name, Type type, string description)> SupportedOptions => []; /// public Dictionary Namespaces => null; diff --git a/Aaru.Filesystems/CPM/File.cs b/Aaru.Filesystems/CPM/File.cs index 93320b28c..51e975a76 100644 --- a/Aaru.Filesystems/CPM/File.cs +++ b/Aaru.Filesystems/CPM/File.cs @@ -46,11 +46,7 @@ public sealed partial class CPM if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -78,11 +74,7 @@ public sealed partial class CPM if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -148,11 +140,7 @@ public sealed partial class CPM if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; diff --git a/Aaru.Filesystems/CPM/Xattr.cs b/Aaru.Filesystems/CPM/Xattr.cs index b96b7aba6..e9b93d7e1 100644 --- a/Aaru.Filesystems/CPM/Xattr.cs +++ b/Aaru.Filesystems/CPM/Xattr.cs @@ -45,19 +45,16 @@ public sealed partial class CPM { if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; if(!_fileCache.ContainsKey(pathElements[0].ToUpperInvariant())) return ErrorNumber.NoSuchFile; if(string.Compare(xattr, "com.caldera.cpm.password", StringComparison.InvariantCulture) == 0) - if(!_passwordCache.TryGetValue(pathElements[0].ToUpperInvariant(), out buf)) - return ErrorNumber.NoError; + { + if(!_passwordCache.TryGetValue(pathElements[0].ToUpperInvariant(), out buf)) return ErrorNumber.NoError; + } if(string.Compare(xattr, "com.caldera.cpm.password.text", StringComparison.InvariantCulture) != 0) return ErrorNumber.NoSuchExtendedAttribute; @@ -74,11 +71,7 @@ public sealed partial class CPM if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; diff --git a/Aaru.Filesystems/FAT/Dir.cs b/Aaru.Filesystems/FAT/Dir.cs index 5c64d6fbb..a5cbeb2b3 100644 --- a/Aaru.Filesystems/FAT/Dir.cs +++ b/Aaru.Filesystems/FAT/Dir.cs @@ -88,11 +88,7 @@ public sealed partial class FAT return ErrorNumber.NoError; } - string[] pieces = cutPath.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pieces = cutPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries); KeyValuePair entry = _rootDirectoryCache.FirstOrDefault(t => t.Key.ToLower(_cultureInfo) == pieces[0]); diff --git a/Aaru.Filesystems/FAT/FAT.cs b/Aaru.Filesystems/FAT/FAT.cs index b3bc19812..d6cd34f90 100644 --- a/Aaru.Filesystems/FAT/FAT.cs +++ b/Aaru.Filesystems/FAT/FAT.cs @@ -67,6 +67,13 @@ public sealed partial class FAT : IReadOnlyFilesystem FileSystemInfo _statfs; bool _useFirstFat; + static Dictionary GetDefaultOptions() => new() + { + { + "debug", false.ToString() + } + }; + #region IReadOnlyFilesystem Members /// @@ -82,8 +89,7 @@ public sealed partial class FAT : IReadOnlyFilesystem public string Author => Authors.NataliaPortillo; /// - public IEnumerable<(string name, Type type, string description)> SupportedOptions => - Array.Empty<(string name, Type type, string description)>(); + public IEnumerable<(string name, Type type, string description)> SupportedOptions => []; /// public Dictionary Namespaces => new() @@ -106,11 +112,4 @@ public sealed partial class FAT : IReadOnlyFilesystem }; #endregion - - static Dictionary GetDefaultOptions() => new() - { - { - "debug", false.ToString() - } - }; } \ No newline at end of file diff --git a/Aaru.Filesystems/FAT/File.cs b/Aaru.Filesystems/FAT/File.cs index 6e9ecad6e..eb865a24e 100644 --- a/Aaru.Filesystems/FAT/File.cs +++ b/Aaru.Filesystems/FAT/File.cs @@ -111,11 +111,7 @@ public sealed partial class FAT string cutPath = path.StartsWith('/') ? path[1..].ToLower(_cultureInfo) : path.ToLower(_cultureInfo); - string[] pieces = cutPath.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pieces = cutPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pieces.Length == 0) return ErrorNumber.InvalidArgument; diff --git a/Aaru.Filesystems/FATX/Dir.cs b/Aaru.Filesystems/FATX/Dir.cs index ed94008df..6f49e89a1 100644 --- a/Aaru.Filesystems/FATX/Dir.cs +++ b/Aaru.Filesystems/FATX/Dir.cs @@ -72,11 +72,7 @@ public sealed partial class XboxFatPlugin return ErrorNumber.NoError; } - string[] pieces = cutPath.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pieces = cutPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries); KeyValuePair entry = _rootDirectory.FirstOrDefault(t => t.Key.ToLower(_cultureInfo) == pieces[0]); diff --git a/Aaru.Filesystems/FATX/FATX.cs b/Aaru.Filesystems/FATX/FATX.cs index eeef2faa7..b3b5d0a1e 100644 --- a/Aaru.Filesystems/FATX/FATX.cs +++ b/Aaru.Filesystems/FATX/FATX.cs @@ -59,6 +59,13 @@ public sealed partial class XboxFatPlugin : IReadOnlyFilesystem FileSystemInfo _statfs; Superblock _superblock; + static Dictionary GetDefaultOptions() => new() + { + { + "debug", false.ToString() + } + }; + #region IReadOnlyFilesystem Members /// @@ -93,18 +100,10 @@ public sealed partial class XboxFatPlugin : IReadOnlyFilesystem } /// - public IEnumerable<(string name, Type type, string description)> SupportedOptions => - Array.Empty<(string name, Type type, string description)>(); + public IEnumerable<(string name, Type type, string description)> SupportedOptions => []; /// public Dictionary Namespaces => null; #endregion - - static Dictionary GetDefaultOptions() => new() - { - { - "debug", false.ToString() - } - }; } \ No newline at end of file diff --git a/Aaru.Filesystems/FATX/File.cs b/Aaru.Filesystems/FATX/File.cs index 7164aac86..62583acee 100644 --- a/Aaru.Filesystems/FATX/File.cs +++ b/Aaru.Filesystems/FATX/File.cs @@ -80,11 +80,7 @@ public sealed partial class XboxFatPlugin string cutPath = path.StartsWith('/') ? path[1..].ToLower(_cultureInfo) : path.ToLower(_cultureInfo); - string[] pieces = cutPath.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pieces = cutPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pieces.Length == 0) return ErrorNumber.InvalidArgument; diff --git a/Aaru.Filesystems/ISO9660/Dir.cs b/Aaru.Filesystems/ISO9660/Dir.cs index ad3f013bc..ef02f545c 100644 --- a/Aaru.Filesystems/ISO9660/Dir.cs +++ b/Aaru.Filesystems/ISO9660/Dir.cs @@ -951,11 +951,7 @@ public sealed partial class ISO9660 ? path[1..].ToLower(CultureInfo.CurrentUICulture) : path.ToLower(CultureInfo.CurrentUICulture); - string[] pieces = cutPath.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pieces = cutPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries); var currentParent = 1; var currentPiece = 0; @@ -1151,11 +1147,7 @@ public sealed partial class ISO9660 return ErrorNumber.NoError; } - string[] pieces = cutPath.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pieces = cutPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries); KeyValuePair entry = _rootDirectoryCache.FirstOrDefault(t => t.Key.Equals(pieces[0], StringComparison.CurrentCultureIgnoreCase)); diff --git a/Aaru.Filesystems/ISO9660/File.cs b/Aaru.Filesystems/ISO9660/File.cs index e2aefbcea..df595b34f 100644 --- a/Aaru.Filesystems/ISO9660/File.cs +++ b/Aaru.Filesystems/ISO9660/File.cs @@ -52,11 +52,7 @@ public sealed partial class ISO9660 ? path[1..].ToLower(CultureInfo.CurrentUICulture) : path.ToLower(CultureInfo.CurrentUICulture); - string[] pieces = cutPath.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pieces = cutPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pieces.Length == 0) return ErrorNumber.InvalidArgument; diff --git a/Aaru.Filesystems/ISO9660/ISO9660.cs b/Aaru.Filesystems/ISO9660/ISO9660.cs index fa202c44b..4e4603b82 100644 --- a/Aaru.Filesystems/ISO9660/ISO9660.cs +++ b/Aaru.Filesystems/ISO9660/ISO9660.cs @@ -76,13 +76,12 @@ public sealed partial class ISO9660 : IReadOnlyFilesystem /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => - new (string name, Type type, string description)[] - { - ("use_path_table", typeof(bool), "Use path table for directory traversal"), - ("use_trans_tbl", typeof(bool), "Use TRANS.TBL for filenames"), - ("use_evd", typeof(bool), - "If present, use Enhanced Volume Descriptor with specified encoding (overrides namespace)") - }; + [ + ("use_path_table", typeof(bool), "Use path table for directory traversal"), + ("use_trans_tbl", typeof(bool), "Use TRANS.TBL for filenames"), + ("use_evd", typeof(bool), + "If present, use Enhanced Volume Descriptor with specified encoding (overrides namespace)") + ]; /// public Dictionary Namespaces => new() diff --git a/Aaru.Filesystems/LisaFS/File.cs b/Aaru.Filesystems/LisaFS/File.cs index 35542eb09..2291335ea 100644 --- a/Aaru.Filesystems/LisaFS/File.cs +++ b/Aaru.Filesystems/LisaFS/File.cs @@ -105,9 +105,8 @@ public sealed partial class LisaFS if(!_mounted || !_debug) return ErrorNumber.AccessDenied; if(fileId is > 4 or <= 0) - { - if(fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED) return ErrorNumber.InvalidArgument; - } + if(fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED) + return ErrorNumber.InvalidArgument; if(_systemFileCache.TryGetValue(fileId, out buf) && !tags) return ErrorNumber.NoError; @@ -330,9 +329,8 @@ public sealed partial class LisaFS if(!tags) { if(_fileSizeCache.TryGetValue(fileId, out int realSize)) - { - if(realSize > temp.Length) AaruLogging.Error(Localization.File_0_gets_truncated, fileId); - } + if(realSize > temp.Length) + AaruLogging.Error(Localization.File_0_gets_truncated, fileId); buf = temp; @@ -351,11 +349,7 @@ public sealed partial class LisaFS if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); switch(pathElements.Length) { diff --git a/Aaru.Filesystems/LisaFS/LisaFS.cs b/Aaru.Filesystems/LisaFS/LisaFS.cs index 67b117c38..d6a1e2307 100644 --- a/Aaru.Filesystems/LisaFS/LisaFS.cs +++ b/Aaru.Filesystems/LisaFS/LisaFS.cs @@ -50,6 +50,13 @@ public sealed partial class LisaFS : IReadOnlyFilesystem SRecord[] _srecords; ulong _volumePrefix; + static Dictionary GetDefaultOptions() => new() + { + { + "debug", false.ToString() + } + }; + #region IReadOnlyFilesystem Members /// @@ -66,8 +73,7 @@ public sealed partial class LisaFS : IReadOnlyFilesystem // TODO: Implement Lisa 7/7 namespace (needs decoding {!CATALOG} file) /// - public IEnumerable<(string name, Type type, string description)> SupportedOptions => - Array.Empty<(string name, Type type, string description)>(); + public IEnumerable<(string name, Type type, string description)> SupportedOptions => []; /// public Dictionary Namespaces => new() @@ -82,13 +88,6 @@ public sealed partial class LisaFS : IReadOnlyFilesystem #endregion - static Dictionary GetDefaultOptions() => new() - { - { - "debug", false.ToString() - } - }; - #region Caches /// Caches Extents Files diff --git a/Aaru.Filesystems/Opera/Dir.cs b/Aaru.Filesystems/Opera/Dir.cs index 245a91688..80eb57c39 100644 --- a/Aaru.Filesystems/Opera/Dir.cs +++ b/Aaru.Filesystems/Opera/Dir.cs @@ -132,11 +132,7 @@ public sealed partial class OperaFS return ErrorNumber.NoError; } - string[] pieces = cutPath.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pieces = cutPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries); KeyValuePair entry = _rootDirectoryCache.FirstOrDefault(t => t.Key.Equals(pieces[0], StringComparison.CurrentCultureIgnoreCase)); diff --git a/Aaru.Filesystems/Opera/File.cs b/Aaru.Filesystems/Opera/File.cs index 0db88d433..825a64b54 100644 --- a/Aaru.Filesystems/Opera/File.cs +++ b/Aaru.Filesystems/Opera/File.cs @@ -47,11 +47,7 @@ public sealed partial class OperaFS ? path[1..].ToLower(CultureInfo.CurrentUICulture) : path.ToLower(CultureInfo.CurrentUICulture); - string[] pieces = cutPath.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pieces = cutPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pieces.Length == 0) return ErrorNumber.InvalidArgument; diff --git a/Aaru.Filesystems/Opera/Opera.cs b/Aaru.Filesystems/Opera/Opera.cs index ed23aaaea..5a20a46c3 100644 --- a/Aaru.Filesystems/Opera/Opera.cs +++ b/Aaru.Filesystems/Opera/Opera.cs @@ -49,6 +49,13 @@ public sealed partial class OperaFS : IReadOnlyFilesystem FileSystemInfo _statfs; uint _volumeBlockSizeRatio; + static Dictionary GetDefaultOptions() => new() + { + { + "debug", false.ToString() + } + }; + #region IReadOnlyFilesystem Members /// @@ -83,18 +90,10 @@ public sealed partial class OperaFS : IReadOnlyFilesystem } /// - public IEnumerable<(string name, Type type, string description)> SupportedOptions => - Array.Empty<(string name, Type type, string description)>(); + public IEnumerable<(string name, Type type, string description)> SupportedOptions => []; /// public Dictionary Namespaces => null; #endregion - - static Dictionary GetDefaultOptions() => new() - { - { - "debug", false.ToString() - } - }; } \ No newline at end of file diff --git a/Aaru.Filesystems/UCSDPascal/File.cs b/Aaru.Filesystems/UCSDPascal/File.cs index eb10358fb..33a4ee99a 100644 --- a/Aaru.Filesystems/UCSDPascal/File.cs +++ b/Aaru.Filesystems/UCSDPascal/File.cs @@ -68,11 +68,7 @@ public sealed partial class PascalPlugin if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -92,11 +88,7 @@ public sealed partial class PascalPlugin if(!_mounted) return ErrorNumber.AccessDenied; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; @@ -175,11 +167,7 @@ public sealed partial class PascalPlugin { stat = null; - string[] pathElements = path.Split(new[] - { - '/' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return ErrorNumber.NotSupported; diff --git a/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs b/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs index d356ea253..d6579d42e 100644 --- a/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs +++ b/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs @@ -56,6 +56,13 @@ public sealed partial class PascalPlugin : IReadOnlyFilesystem /// Apple II disks use 256 bytes / sector, but filesystem assumes it's 512 bytes / sector uint _multiplier; + static Dictionary GetDefaultOptions() => new() + { + { + "debug", false.ToString() + } + }; + #region IReadOnlyFilesystem Members /// @@ -90,18 +97,10 @@ public sealed partial class PascalPlugin : IReadOnlyFilesystem } /// - public IEnumerable<(string name, Type type, string description)> SupportedOptions => - Array.Empty<(string name, Type type, string description)>(); + public IEnumerable<(string name, Type type, string description)> SupportedOptions => []; /// public Dictionary Namespaces => null; #endregion - - static Dictionary GetDefaultOptions() => new() - { - { - "debug", false.ToString() - } - }; } \ No newline at end of file diff --git a/Aaru.Gui/Controls/HexViewPanel.cs b/Aaru.Gui/Controls/HexViewPanel.cs index 4001ce98c..bcbbf21e5 100644 --- a/Aaru.Gui/Controls/HexViewPanel.cs +++ b/Aaru.Gui/Controls/HexViewPanel.cs @@ -299,7 +299,7 @@ public class HexViewPanel : UserControl private void OnDataChanged() { - _data = Data ?? Array.Empty(); + _data = Data ?? []; UpdateDisplay(); } @@ -329,9 +329,8 @@ public class HexViewPanel : UserControl foreach(ColorRange range in ColorRanges) { for(int i = range.Start; i <= range.End && i < _data.Length; i++) - { - if(!colorLookup.ContainsKey(i)) colorLookup[i] = range.Color; - } + if(!colorLookup.ContainsKey(i)) + colorLookup[i] = range.Color; } } diff --git a/Aaru.Gui/ViewModels/Windows/MediaScanViewModel.cs b/Aaru.Gui/ViewModels/Windows/MediaScanViewModel.cs index fccf01273..078a39ec0 100644 --- a/Aaru.Gui/ViewModels/Windows/MediaScanViewModel.cs +++ b/Aaru.Gui/ViewModels/Windows/MediaScanViewModel.cs @@ -63,7 +63,7 @@ public sealed partial class MediaScanViewModel : ViewModelBase { readonly Device _device; readonly string _devicePath; - readonly List<(ulong startingSector, double duration)> _pendingSectorData = new(); + readonly List<(ulong startingSector, double duration)> _pendingSectorData = []; readonly object _pendingSectorDataLock = new(); readonly Window _view; [ObservableProperty] diff --git a/Aaru.Images/A2R/Properties.cs b/Aaru.Images/A2R/Properties.cs index 199be0520..ca94af481 100644 --- a/Aaru.Images/A2R/Properties.cs +++ b/Aaru.Images/A2R/Properties.cs @@ -75,28 +75,24 @@ public sealed partial class A2R #region IWritableImage Members /// - public IEnumerable KnownExtensions => new[] - { - ".a2r" - }; + public IEnumerable KnownExtensions => [".a2r"]; /// public IEnumerable SupportedMediaTags => null; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ // TODO: A2R supports a lot more formats, please add more whence tested. MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD, MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.Apple32SS, MediaType.AppleSonyDS, MediaType.Unknown - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/Alcohol120/Properties.cs b/Aaru.Images/Alcohol120/Properties.cs index e30c3e55f..3bcb72702 100644 --- a/Aaru.Images/Alcohol120/Properties.cs +++ b/Aaru.Images/Alcohol120/Properties.cs @@ -159,46 +159,43 @@ public sealed partial class Alcohol120 public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => new[] - { + public IEnumerable SupportedMediaTags => + [ MediaTagType.CD_FullTOC, MediaTagType.DVD_BCA, MediaTagType.DVD_DMI, MediaTagType.DVD_PFI - }; + ]; /// - public IEnumerable SupportedSectorTags => new[] - { - SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, SectorTagType.CdSectorEdc, - SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubHeader, SectorTagType.CdSectorSync, - SectorTagType.CdTrackFlags, SectorTagType.CdSectorSubchannel - }; + public IEnumerable SupportedSectorTags => + [ + SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, + SectorTagType.CdSectorEdc, SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubHeader, + SectorTagType.CdSectorSync, SectorTagType.CdTrackFlags, SectorTagType.CdSectorSubchannel + ]; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.BDR, MediaType.BDRE, MediaType.BDREXL, MediaType.BDROM, MediaType.UHDBD, MediaType.BDRXL, - MediaType.CBHD, MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, MediaType.CDMIDI, - MediaType.CDMRW, MediaType.CDPLUS, MediaType.CDR, MediaType.CDROM, MediaType.CDROMXA, MediaType.CDRW, - MediaType.CDV, MediaType.DVDDownload, MediaType.DVDPR, MediaType.DVDPRDL, MediaType.DVDPRW, MediaType.DVDPRWDL, - MediaType.DVDR, MediaType.DVDRAM, MediaType.DVDRDL, MediaType.DVDROM, MediaType.DVDRW, MediaType.DVDRWDL, - MediaType.EVD, MediaType.FDDVD, MediaType.DTSCD, MediaType.FVD, MediaType.HDDVDR, MediaType.HDDVDRAM, - MediaType.HDDVDRDL, MediaType.HDDVDROM, MediaType.HDDVDRW, MediaType.HDDVDRWDL, MediaType.HDVMD, MediaType.HVD, - MediaType.JaguarCD, MediaType.MEGACD, MediaType.PS1CD, MediaType.PS2CD, MediaType.PS2DVD, MediaType.PS3BD, - MediaType.PS3DVD, MediaType.PS4BD, MediaType.PS5BD, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SVOD, - MediaType.SATURNCD, MediaType.ThreeDO, MediaType.UDO, MediaType.UDO2, MediaType.UDO2_WORM, MediaType.UMD, - MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.CD32, - MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, - MediaType.VideoNowColor, MediaType.VideoNowXp, MediaType.CVD, MediaType.PCD - }; + MediaType.CBHD, MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, + MediaType.CDMIDI, MediaType.CDMRW, MediaType.CDPLUS, MediaType.CDR, MediaType.CDROM, MediaType.CDROMXA, + MediaType.CDRW, MediaType.CDV, MediaType.DVDDownload, MediaType.DVDPR, MediaType.DVDPRDL, MediaType.DVDPRW, + MediaType.DVDPRWDL, MediaType.DVDR, MediaType.DVDRAM, MediaType.DVDRDL, MediaType.DVDROM, MediaType.DVDRW, + MediaType.DVDRWDL, MediaType.EVD, MediaType.FDDVD, MediaType.DTSCD, MediaType.FVD, MediaType.HDDVDR, + MediaType.HDDVDRAM, MediaType.HDDVDRDL, MediaType.HDDVDROM, MediaType.HDDVDRW, MediaType.HDDVDRWDL, + MediaType.HDVMD, MediaType.HVD, MediaType.JaguarCD, MediaType.MEGACD, MediaType.PS1CD, MediaType.PS2CD, + MediaType.PS2DVD, MediaType.PS3BD, MediaType.PS3DVD, MediaType.PS4BD, MediaType.PS5BD, + MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SVOD, MediaType.SATURNCD, MediaType.ThreeDO, MediaType.UDO, + MediaType.UDO2, MediaType.UDO2_WORM, MediaType.UMD, MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, + MediaType.PCFX, MediaType.CDTV, MediaType.CD32, MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, + MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, MediaType.VideoNowColor, MediaType.VideoNowXp, + MediaType.CVD, MediaType.PCD + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".mds" - }; + public IEnumerable KnownExtensions => [".mds"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/Anex86/Properties.cs b/Aaru.Images/Anex86/Properties.cs index 3ac68c320..e4d9bf75c 100644 --- a/Aaru.Images/Anex86/Properties.cs +++ b/Aaru.Images/Anex86/Properties.cs @@ -67,15 +67,15 @@ public sealed partial class Anex86 public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; // TODO: Test with real hardware to see real supported media /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.IBM23FD, MediaType.ECMA_66, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, MediaType.ACORN_525_SS_SD_40, MediaType.ACORN_525_SS_DD_40, MediaType.ATARI_525_SD, MediaType.ATARI_525_DD, MediaType.ATARI_525_ED, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_DS_DD_9, MediaType.ECMA_70, @@ -85,20 +85,17 @@ public sealed partial class Anex86 MediaType.ACORN_35_DS_DD, MediaType.DOS_35_DS_DD_8, MediaType.DOS_35_DS_DD_9, MediaType.ACORN_35_DS_HD, MediaType.DOS_525_HD, MediaType.ACORN_525_DS_DD, MediaType.DOS_35_HD, MediaType.XDF_525, MediaType.DMF, MediaType.XDF_35, MediaType.DOS_35_ED, MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_525_HD, - MediaType.FDFORMAT_35_HD, MediaType.NEC_35_TD, MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, - MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, - MediaType.PCCardTypeIII, MediaType.PCCardTypeIV, MediaType.MetaFloppy_Mod_I, MediaType.MetaFloppy_Mod_II - }; + MediaType.FDFORMAT_35_HD, MediaType.NEC_35_TD, MediaType.Unknown, MediaType.GENERIC_HDD, + MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, + MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV, MediaType.MetaFloppy_Mod_I, + MediaType.MetaFloppy_Mod_II + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".fdi", ".hdi" - }; + public IEnumerable KnownExtensions => [".fdi", ".hdi"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/Apple2MG/Properties.cs b/Aaru.Images/Apple2MG/Properties.cs index 11eae7541..1b2bc5b64 100644 --- a/Aaru.Images/Apple2MG/Properties.cs +++ b/Aaru.Images/Apple2MG/Properties.cs @@ -67,29 +67,25 @@ public sealed partial class Apple2Mg public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.Apple32SS, MediaType.Apple33SS, MediaType.AppleSonySS, MediaType.AppleSonyDS, MediaType.DOS_35_HD, MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".2mg" - }; + public IEnumerable KnownExtensions => [".2mg"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/AppleDOS/Properties.cs b/Aaru.Images/AppleDOS/Properties.cs index 5676b5cfd..eedc884b6 100644 --- a/Aaru.Images/AppleDOS/Properties.cs +++ b/Aaru.Images/AppleDOS/Properties.cs @@ -69,26 +69,19 @@ public sealed partial class AppleDos public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.Apple33SS - }; + public IEnumerable SupportedMediaTypes => [MediaType.Apple33SS]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".do", ".po" - }; + public IEnumerable KnownExtensions => [".do", ".po"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/Apridisk/Properties.cs b/Aaru.Images/Apridisk/Properties.cs index 0501a0569..a19830cbc 100644 --- a/Aaru.Images/Apridisk/Properties.cs +++ b/Aaru.Images/Apridisk/Properties.cs @@ -67,35 +67,32 @@ public sealed partial class Apridisk public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; // TODO: Test with real hardware to see real supported media /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.ACORN_35_DS_DD, MediaType.ACORN_35_DS_HD, MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, MediaType.ATARI_35_DS_DD_11, MediaType.ATARI_35_SS_DD, MediaType.ATARI_35_SS_DD_11, MediaType.DMF, - MediaType.DMF_82, MediaType.DOS_35_DS_DD_8, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED, MediaType.DOS_35_HD, - MediaType.DOS_35_SS_DD_8, MediaType.DOS_35_SS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_DS_DD_9, - MediaType.DOS_525_HD, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, MediaType.FDFORMAT_35_DD, - MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, - MediaType.XDF_35, MediaType.XDF_525, MediaType.MetaFloppy_Mod_I, MediaType.MetaFloppy_Mod_II - }; + MediaType.DMF_82, MediaType.DOS_35_DS_DD_8, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED, + MediaType.DOS_35_HD, MediaType.DOS_35_SS_DD_8, MediaType.DOS_35_SS_DD_9, MediaType.DOS_525_DS_DD_8, + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, + MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, + MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525, MediaType.MetaFloppy_Mod_I, MediaType.MetaFloppy_Mod_II + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] - { - ("compress", typeof(bool), Localization.Enable_Apridisk_compression, (object)false) - }; + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => + [ + ("compress", typeof(bool), Localization.Enable_Apridisk_compression, false) + ]; /// - public IEnumerable KnownExtensions => new[] - { - ".dsk" - }; + public IEnumerable KnownExtensions => [".dsk"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/BLU/Properties.cs b/Aaru.Images/BLU/Properties.cs index a949cfd5d..e5a18fc7e 100644 --- a/Aaru.Images/BLU/Properties.cs +++ b/Aaru.Images/BLU/Properties.cs @@ -69,31 +69,24 @@ public sealed partial class Blu public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => new[] - { - SectorTagType.AppleSonyTag - }; + public IEnumerable SupportedSectorTags => [SectorTagType.AppleSonyTag]; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.AppleProfile, MediaType.AppleWidget, MediaType.PriamDataTower, MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".blu" - }; // Just invented + public IEnumerable KnownExtensions => [".blu"]; // Just invented /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/BlindWrite4/Read.cs b/Aaru.Images/BlindWrite4/Read.cs index b9c8055f8..3d545ce72 100644 --- a/Aaru.Images/BlindWrite4/Read.cs +++ b/Aaru.Images/BlindWrite4/Read.cs @@ -407,10 +407,8 @@ public sealed partial class BlindWrite4 if(_dataFilter != null) break; _dataFilter = PluginRegister.Singleton.GetFilter(Path.Combine(imageFilter.ParentFolder, - _header.DataFile.Split(new[] - { - '\\' - }, + _header.DataFile + .Split(['\\'], StringSplitOptions .RemoveEmptyEntries) .Last())); @@ -418,10 +416,8 @@ public sealed partial class BlindWrite4 if(_dataFilter != null) break; _dataFilter = PluginRegister.Singleton.GetFilter(Path.Combine(imageFilter.ParentFolder, - _header.DataFile.Split(new[] - { - '\\' - }, + _header.DataFile + .Split(['\\'], StringSplitOptions .RemoveEmptyEntries) .Last() @@ -430,10 +426,8 @@ public sealed partial class BlindWrite4 if(_dataFilter != null) break; _dataFilter = PluginRegister.Singleton.GetFilter(Path.Combine(imageFilter.ParentFolder, - _header.DataFile.Split(new[] - { - '\\' - }, + _header.DataFile + .Split(['\\'], StringSplitOptions .RemoveEmptyEntries) .Last() @@ -465,26 +459,21 @@ public sealed partial class BlindWrite4 _header.SubchannelFile .ToUpper(CultureInfo.CurrentCulture)))) ?? PluginRegister.Singleton.GetFilter(Path.Combine(imageFilter.ParentFolder, - _header.SubchannelFile.Split(new[] - { - '\\' - }, - StringSplitOptions.RemoveEmptyEntries) + _header.SubchannelFile + .Split(['\\'], + StringSplitOptions + .RemoveEmptyEntries) .Last()))) ?? PluginRegister.Singleton.GetFilter(Path.Combine(imageFilter.ParentFolder, - _header.SubchannelFile.Split(new[] - { - '\\' - }, - StringSplitOptions.RemoveEmptyEntries) + _header.SubchannelFile + .Split(['\\'], + StringSplitOptions.RemoveEmptyEntries) .Last() .ToLower(CultureInfo.CurrentCulture)))) ?? PluginRegister.Singleton.GetFilter(Path.Combine(imageFilter.ParentFolder, - _header.SubchannelFile.Split(new[] - { - '\\' - }, - StringSplitOptions.RemoveEmptyEntries) + _header.SubchannelFile + .Split(['\\'], + StringSplitOptions.RemoveEmptyEntries) .Last() .ToUpper(CultureInfo.CurrentCulture))); } @@ -532,10 +521,8 @@ public sealed partial class BlindWrite4 if(track.Filter != null) break; track.Filter = PluginRegister.Singleton.GetFilter(Path.Combine(imageFilter.ParentFolder, - bwTrack.filename.Split(new[] - { - '\\' - }, + bwTrack.filename + .Split(['\\'], StringSplitOptions .RemoveEmptyEntries) .Last())); @@ -543,10 +530,8 @@ public sealed partial class BlindWrite4 if(track.Filter != null) break; track.Filter = PluginRegister.Singleton.GetFilter(Path.Combine(imageFilter.ParentFolder, - bwTrack.filename.Split(new[] - { - '\\' - }, + bwTrack.filename + .Split(['\\'], StringSplitOptions .RemoveEmptyEntries) .Last() @@ -556,10 +541,8 @@ public sealed partial class BlindWrite4 if(track.Filter != null) break; track.Filter = PluginRegister.Singleton.GetFilter(Path.Combine(imageFilter.ParentFolder, - bwTrack.filename.Split(new[] - { - '\\' - }, + bwTrack.filename + .Split(['\\'], StringSplitOptions .RemoveEmptyEntries) .Last() @@ -745,9 +728,8 @@ public sealed partial class BlindWrite4 // As long as subchannel is written for any track, it is present for all tracks if(Tracks.Any(static t => t.SubchannelType == TrackSubchannelType.Packed)) - { - foreach(Track track in Tracks) track.SubchannelType = TrackSubchannelType.Packed; - } + foreach(Track track in Tracks) + track.SubchannelType = TrackSubchannelType.Packed; _imageInfo.MediaType = MediaType.CD; diff --git a/Aaru.Images/ByteAddressable/AtariLynx.cs b/Aaru.Images/ByteAddressable/AtariLynx.cs index bf3bd70a2..f766e112a 100644 --- a/Aaru.Images/ByteAddressable/AtariLynx.cs +++ b/Aaru.Images/ByteAddressable/AtariLynx.cs @@ -136,26 +136,19 @@ public partial class AtariLynx : IByteAddressableImage public bool IsWriting { get; private set; } /// - public IEnumerable KnownExtensions => new[] - { - ".lnx" - }; + public IEnumerable KnownExtensions => [".lnx"]; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.AtariLynxCard - }; + public IEnumerable SupportedMediaTypes => [MediaType.AtariLynxCard]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, diff --git a/Aaru.Images/ByteAddressable/GameBoy.cs b/Aaru.Images/ByteAddressable/GameBoy.cs index 7cdc063c7..851931038 100644 --- a/Aaru.Images/ByteAddressable/GameBoy.cs +++ b/Aaru.Images/ByteAddressable/GameBoy.cs @@ -146,26 +146,19 @@ public partial class GameBoy : IByteAddressableImage public bool IsWriting { get; private set; } /// - public IEnumerable KnownExtensions => new[] - { - ".gb", ".gbc", ".sgb" - }; + public IEnumerable KnownExtensions => [".gb", ".gbc", ".sgb"]; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.GameBoyGamePak - }; + public IEnumerable SupportedMediaTypes => [MediaType.GameBoyGamePak]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, diff --git a/Aaru.Images/ByteAddressable/GameBoyAdvance.cs b/Aaru.Images/ByteAddressable/GameBoyAdvance.cs index c702d11be..1ed81e807 100644 --- a/Aaru.Images/ByteAddressable/GameBoyAdvance.cs +++ b/Aaru.Images/ByteAddressable/GameBoyAdvance.cs @@ -126,26 +126,19 @@ public partial class GameBoyAdvance : IByteAddressableImage public bool IsWriting { get; private set; } /// - public IEnumerable KnownExtensions => new[] - { - ".gba" - }; + public IEnumerable KnownExtensions => [".gba"]; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.GameBoyAdvanceGamePak - }; + public IEnumerable SupportedMediaTypes => [MediaType.GameBoyAdvanceGamePak]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, diff --git a/Aaru.Images/ByteAddressable/MasterSystem.cs b/Aaru.Images/ByteAddressable/MasterSystem.cs index 8f6f4dbff..0544bdba1 100644 --- a/Aaru.Images/ByteAddressable/MasterSystem.cs +++ b/Aaru.Images/ByteAddressable/MasterSystem.cs @@ -229,26 +229,19 @@ public partial class MasterSystem : IByteAddressableImage public bool IsWriting { get; private set; } /// - public IEnumerable KnownExtensions => new[] - { - ".sms", ".gg" - }; + public IEnumerable KnownExtensions => [".sms", ".gg"]; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.MasterSystemCartridge, MediaType.GameGearCartridge - }; + public IEnumerable SupportedMediaTypes => [MediaType.MasterSystemCartridge, MediaType.GameGearCartridge]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, diff --git a/Aaru.Images/ByteAddressable/NES.cs b/Aaru.Images/ByteAddressable/NES.cs index db2c27811..e00825042 100644 --- a/Aaru.Images/ByteAddressable/NES.cs +++ b/Aaru.Images/ByteAddressable/NES.cs @@ -272,26 +272,19 @@ public class Nes : IByteAddressableImage public bool IsWriting { get; private set; } /// - public IEnumerable KnownExtensions => new[] - { - ".nes" - }; + public IEnumerable KnownExtensions => [".nes"]; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.NESGamePak, MediaType.FamicomGamePak - }; + public IEnumerable SupportedMediaTypes => [MediaType.NESGamePak, MediaType.FamicomGamePak]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, diff --git a/Aaru.Images/ByteAddressable/Nintendo64.cs b/Aaru.Images/ByteAddressable/Nintendo64.cs index d8bc93010..a6ec8f6c3 100644 --- a/Aaru.Images/ByteAddressable/Nintendo64.cs +++ b/Aaru.Images/ByteAddressable/Nintendo64.cs @@ -797,26 +797,19 @@ public partial class Nintendo64 : IByteAddressableImage public bool IsWriting { get; private set; } /// - public IEnumerable KnownExtensions => new[] - { - ".n64", ".v64", ".z64" - }; + public IEnumerable KnownExtensions => [".n64", ".v64", ".z64"]; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.N64GamePak - }; + public IEnumerable SupportedMediaTypes => [MediaType.N64GamePak]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, diff --git a/Aaru.Images/ByteAddressable/SegaMegaDrive.cs b/Aaru.Images/ByteAddressable/SegaMegaDrive.cs index f7e70a969..b67bf239b 100644 --- a/Aaru.Images/ByteAddressable/SegaMegaDrive.cs +++ b/Aaru.Images/ByteAddressable/SegaMegaDrive.cs @@ -361,26 +361,22 @@ public partial class SegaMegaDrive : IByteAddressableImage public bool IsWriting { get; private set; } /// - public IEnumerable KnownExtensions => new[] - { - ".smd", ".md", ".32x" - }; + public IEnumerable KnownExtensions => [".smd", ".md", ".32x"]; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType._32XCartridge, MediaType.MegaDriveCartridge, MediaType.SegaPicoCartridge - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, diff --git a/Aaru.Images/ByteAddressable/SuperNintendo.cs b/Aaru.Images/ByteAddressable/SuperNintendo.cs index 9123b216b..43a5500ab 100644 --- a/Aaru.Images/ByteAddressable/SuperNintendo.cs +++ b/Aaru.Images/ByteAddressable/SuperNintendo.cs @@ -249,26 +249,19 @@ public class SuperNintendo : IByteAddressableImage public bool IsWriting { get; private set; } /// - public IEnumerable KnownExtensions => new[] - { - ".sfc" - }; + public IEnumerable KnownExtensions => [".sfc"]; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.SNESGamePak, MediaType.SNESGamePakUS - }; + public IEnumerable SupportedMediaTypes => [MediaType.SNESGamePak, MediaType.SNESGamePakUS]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, diff --git a/Aaru.Images/CDRDAO/Properties.cs b/Aaru.Images/CDRDAO/Properties.cs index 3de0ab9a9..c8920c71c 100644 --- a/Aaru.Images/CDRDAO/Properties.cs +++ b/Aaru.Images/CDRDAO/Properties.cs @@ -185,42 +185,37 @@ public sealed partial class Cdrdao // TODO: Decode CD-Text to text /// - public IEnumerable SupportedMediaTags => new[] - { - MediaTagType.CD_MCN - }; + public IEnumerable SupportedMediaTags => [MediaTagType.CD_MCN]; /// - public IEnumerable SupportedSectorTags => new[] - { - SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, SectorTagType.CdSectorEdc, - SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubchannel, SectorTagType.CdSectorSubHeader, - SectorTagType.CdSectorSync, SectorTagType.CdTrackFlags, SectorTagType.CdTrackIsrc - }; + public IEnumerable SupportedSectorTags => + [ + SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, + SectorTagType.CdSectorEdc, SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubchannel, + SectorTagType.CdSectorSubHeader, SectorTagType.CdSectorSync, SectorTagType.CdTrackFlags, + SectorTagType.CdTrackIsrc + ]; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, MediaType.CDMIDI, MediaType.CDMRW, - MediaType.CDPLUS, MediaType.CDR, MediaType.CDROM, MediaType.CDROMXA, MediaType.CDRW, MediaType.CDV, - MediaType.DDCD, MediaType.DDCDR, MediaType.DDCDRW, MediaType.MEGACD, MediaType.PS1CD, MediaType.PS2CD, - MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SATURNCD, MediaType.ThreeDO, MediaType.VCD, MediaType.VCDHD, - MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.CD32, MediaType.Nuon, MediaType.Playdia, - MediaType.Pippin, MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, MediaType.VideoNowColor, - MediaType.VideoNowXp, MediaType.CVD, MediaType.PCD - }; + public IEnumerable SupportedMediaTypes => + [ + MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, MediaType.CDMIDI, + MediaType.CDMRW, MediaType.CDPLUS, MediaType.CDR, MediaType.CDROM, MediaType.CDROMXA, MediaType.CDRW, + MediaType.CDV, MediaType.DDCD, MediaType.DDCDR, MediaType.DDCDRW, MediaType.MEGACD, MediaType.PS1CD, + MediaType.PS2CD, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SATURNCD, MediaType.ThreeDO, + MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.CD32, + MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, + MediaType.VideoNowColor, MediaType.VideoNowXp, MediaType.CVD, MediaType.PCD + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] - { - ("separate", typeof(bool), Localization.Write_each_track_to_a_separate_file, (object)false) - }; + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => + [ + ("separate", typeof(bool), Localization.Write_each_track_to_a_separate_file, false) + ]; /// - public IEnumerable KnownExtensions => new[] - { - ".toc" - }; + public IEnumerable KnownExtensions => [".toc"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/CDRDAO/Write.cs b/Aaru.Images/CDRDAO/Write.cs index e7dba950a..0b99fbdea 100644 --- a/Aaru.Images/CDRDAO/Write.cs +++ b/Aaru.Images/CDRDAO/Write.cs @@ -501,8 +501,9 @@ public sealed partial class Cdrdao } if(_writingTracks != null && _writingStreams != null) - foreach(FileStream oldTrack in _writingStreams.Select(static t => t.Value).Distinct()) - oldTrack.Close(); + { + foreach(FileStream oldTrack in _writingStreams.Select(static t => t.Value).Distinct()) oldTrack.Close(); + } ulong currentOffset = 0; _writingTracks = []; @@ -598,11 +599,7 @@ public sealed partial class Cdrdao if(!string.IsNullOrWhiteSpace(_discimage.Comment)) { - string[] commentLines = _discimage.Comment.Split(new[] - { - '\n' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] commentLines = _discimage.Comment.Split(['\n'], StringSplitOptions.RemoveEmptyEntries); foreach(string line in commentLines) _descriptorStream.WriteLine("// {0}", line); } diff --git a/Aaru.Images/CDRWin/Properties.cs b/Aaru.Images/CDRWin/Properties.cs index e27827f5d..158f03369 100644 --- a/Aaru.Images/CDRWin/Properties.cs +++ b/Aaru.Images/CDRWin/Properties.cs @@ -90,7 +90,7 @@ public sealed partial class CdrWin ulong previousStartSector = 0; const ulong gdRomSession2Offset = 45000; - string previousTrackFile = ""; + var previousTrackFile = ""; foreach(CdrWinTrack cdrTrack in _discImage.Tracks) { @@ -178,49 +178,43 @@ public sealed partial class CdrWin public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => new[] - { - MediaTagType.CD_MCN, MediaTagType.CD_TEXT - }; + public IEnumerable SupportedMediaTags => [MediaTagType.CD_MCN, MediaTagType.CD_TEXT]; /// - public IEnumerable SupportedSectorTags => new[] - { - SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, SectorTagType.CdSectorEdc, - SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubHeader, SectorTagType.CdSectorSync, - SectorTagType.CdTrackFlags, SectorTagType.CdTrackIsrc - }; + public IEnumerable SupportedSectorTags => + [ + SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, + SectorTagType.CdSectorEdc, SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubHeader, + SectorTagType.CdSectorSync, SectorTagType.CdTrackFlags, SectorTagType.CdTrackIsrc + ]; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.BDR, MediaType.BDRE, MediaType.BDREXL, MediaType.BDROM, MediaType.UHDBD, MediaType.BDRXL, - MediaType.CBHD, MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, MediaType.CDMIDI, - MediaType.CDMRW, MediaType.CDPLUS, MediaType.CDR, MediaType.CDROM, MediaType.CDROMXA, MediaType.CDRW, - MediaType.CDV, MediaType.DDCD, MediaType.DDCDR, MediaType.DDCDRW, MediaType.DVDDownload, MediaType.DVDPR, - MediaType.DVDPRDL, MediaType.DVDPRW, MediaType.DVDPRWDL, MediaType.DVDR, MediaType.DVDRAM, MediaType.DVDRDL, - MediaType.DVDROM, MediaType.DVDRW, MediaType.DVDRWDL, MediaType.EVD, MediaType.FDDVD, MediaType.DTSCD, - MediaType.FVD, MediaType.HDDVDR, MediaType.HDDVDRAM, MediaType.HDDVDRDL, MediaType.HDDVDROM, MediaType.HDDVDRW, - MediaType.HDDVDRWDL, MediaType.HDVMD, MediaType.HVD, MediaType.JaguarCD, MediaType.MEGACD, MediaType.PS1CD, - MediaType.PS2CD, MediaType.PS2DVD, MediaType.PS3BD, MediaType.PS3DVD, MediaType.PS4BD, MediaType.PS5BD, - MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SVOD, MediaType.SATURNCD, MediaType.ThreeDO, MediaType.UDO, - MediaType.UDO2, MediaType.UDO2_WORM, MediaType.UMD, MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, - MediaType.PCFX, MediaType.CDTV, MediaType.CD32, MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, - MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, MediaType.VideoNowColor, MediaType.VideoNowXp, - MediaType.CVD, MediaType.PCD - }; + MediaType.CBHD, MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, + MediaType.CDMIDI, MediaType.CDMRW, MediaType.CDPLUS, MediaType.CDR, MediaType.CDROM, MediaType.CDROMXA, + MediaType.CDRW, MediaType.CDV, MediaType.DDCD, MediaType.DDCDR, MediaType.DDCDRW, MediaType.DVDDownload, + MediaType.DVDPR, MediaType.DVDPRDL, MediaType.DVDPRW, MediaType.DVDPRWDL, MediaType.DVDR, MediaType.DVDRAM, + MediaType.DVDRDL, MediaType.DVDROM, MediaType.DVDRW, MediaType.DVDRWDL, MediaType.EVD, MediaType.FDDVD, + MediaType.DTSCD, MediaType.FVD, MediaType.HDDVDR, MediaType.HDDVDRAM, MediaType.HDDVDRDL, + MediaType.HDDVDROM, MediaType.HDDVDRW, MediaType.HDDVDRWDL, MediaType.HDVMD, MediaType.HVD, + MediaType.JaguarCD, MediaType.MEGACD, MediaType.PS1CD, MediaType.PS2CD, MediaType.PS2DVD, MediaType.PS3BD, + MediaType.PS3DVD, MediaType.PS4BD, MediaType.PS5BD, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SVOD, + MediaType.SATURNCD, MediaType.ThreeDO, MediaType.UDO, MediaType.UDO2, MediaType.UDO2_WORM, MediaType.UMD, + MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.CD32, + MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, + MediaType.VideoNowColor, MediaType.VideoNowXp, MediaType.CVD, MediaType.PCD + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] - { - ("separate", typeof(bool), Localization.Write_each_track_to_a_separate_file, (object)false) - }; + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => + [ + ("separate", typeof(bool), Localization.Write_each_track_to_a_separate_file, false) + ]; /// - public IEnumerable KnownExtensions => new[] - { - ".cue" - }; + public IEnumerable KnownExtensions => [".cue"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/CDRWin/Write.cs b/Aaru.Images/CDRWin/Write.cs index c151f5f20..e5d75475d 100644 --- a/Aaru.Images/CDRWin/Write.cs +++ b/Aaru.Images/CDRWin/Write.cs @@ -436,8 +436,9 @@ public sealed partial class CdrWin } if(_writingTracks != null && _writingStreams != null) - foreach(FileStream oldTrack in _writingStreams.Select(static t => t.Value).Distinct()) - oldTrack.Close(); + { + foreach(FileStream oldTrack in _writingStreams.Select(static t => t.Value).Distinct()) oldTrack.Close(); + } _writingTracks = []; @@ -505,11 +506,7 @@ public sealed partial class CdrWin if(!string.IsNullOrWhiteSpace(_discImage.Comment)) { - string[] commentLines = _discImage.Comment.Split(new[] - { - '\n' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] commentLines = _discImage.Comment.Split(['\n'], StringSplitOptions.RemoveEmptyEntries); foreach(string line in commentLines) _descriptorStream.WriteLine("REM {0}", line); } diff --git a/Aaru.Images/CisCopy/Properties.cs b/Aaru.Images/CisCopy/Properties.cs index a8e91ab57..bd3014776 100644 --- a/Aaru.Images/CisCopy/Properties.cs +++ b/Aaru.Images/CisCopy/Properties.cs @@ -67,28 +67,24 @@ public sealed partial class CisCopy public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; // TODO: Test with real hardware to see real supported media /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9 - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".dcf" - }; + public IEnumerable KnownExtensions => [".dcf"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/CloneCD/Properties.cs b/Aaru.Images/CloneCD/Properties.cs index 4ea0c2d40..f73d6cfbc 100644 --- a/Aaru.Images/CloneCD/Properties.cs +++ b/Aaru.Images/CloneCD/Properties.cs @@ -93,40 +93,33 @@ public sealed partial class CloneCd public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => new[] - { - MediaTagType.CD_MCN, MediaTagType.CD_FullTOC - }; + public IEnumerable SupportedMediaTags => [MediaTagType.CD_MCN, MediaTagType.CD_FullTOC]; /// - public IEnumerable SupportedSectorTags => new[] - { - SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, SectorTagType.CdSectorEdc, - SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubHeader, SectorTagType.CdSectorSync, - SectorTagType.CdTrackFlags, SectorTagType.CdSectorSubchannel - }; + public IEnumerable SupportedSectorTags => + [ + SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, + SectorTagType.CdSectorEdc, SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubHeader, + SectorTagType.CdSectorSync, SectorTagType.CdTrackFlags, SectorTagType.CdSectorSubchannel + ]; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, MediaType.CDMIDI, MediaType.CDMRW, - MediaType.CDPLUS, MediaType.CDR, MediaType.CDROM, MediaType.CDROMXA, MediaType.CDRW, MediaType.CDV, - MediaType.DTSCD, MediaType.JaguarCD, MediaType.MEGACD, MediaType.PS1CD, MediaType.PS2CD, MediaType.SuperCDROM2, - MediaType.SVCD, MediaType.SATURNCD, MediaType.ThreeDO, MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, - MediaType.PCFX, MediaType.CDTV, MediaType.CD32, MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, - MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, MediaType.VideoNowColor, MediaType.VideoNowXp, - MediaType.CVD, MediaType.PCD - }; + public IEnumerable SupportedMediaTypes => + [ + MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, MediaType.CDMIDI, + MediaType.CDMRW, MediaType.CDPLUS, MediaType.CDR, MediaType.CDROM, MediaType.CDROMXA, MediaType.CDRW, + MediaType.CDV, MediaType.DTSCD, MediaType.JaguarCD, MediaType.MEGACD, MediaType.PS1CD, MediaType.PS2CD, + MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SATURNCD, MediaType.ThreeDO, MediaType.VCD, + MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.CD32, MediaType.Nuon, + MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, + MediaType.VideoNowColor, MediaType.VideoNowXp, MediaType.CVD, MediaType.PCD + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".ccd" - }; + public IEnumerable KnownExtensions => [".ccd"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/CloneCD/Read.cs b/Aaru.Images/CloneCD/Read.cs index 44081cf61..47d0649f3 100644 --- a/Aaru.Images/CloneCD/Read.cs +++ b/Aaru.Images/CloneCD/Read.cs @@ -226,11 +226,7 @@ public sealed partial class CloneCd AaruLogging.Debug(MODULE_NAME, Localization.Found_CD_Text_Entry_at_line_0, lineNumber); string[] bytes = cdtEntMatch.Groups["value"] - .Value.Split(new[] - { - ' ' - }, - StringSplitOptions.RemoveEmptyEntries); + .Value.Split([' '], StringSplitOptions.RemoveEmptyEntries); foreach(string byt in bytes) cdtMs.WriteByte(Convert.ToByte(byt, 16)); } diff --git a/Aaru.Images/CopyTape/CopyTape.cs b/Aaru.Images/CopyTape/CopyTape.cs index d6ad87e7d..2be02dbba 100644 --- a/Aaru.Images/CopyTape/CopyTape.cs +++ b/Aaru.Images/CopyTape/CopyTape.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; using System.IO; -using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Interfaces; using Aaru.CommonTypes.Structs; @@ -16,8 +14,8 @@ public sealed partial class CopyTape : IWritableTapeImage public CopyTape() => _imageInfo = new ImageInfo { - ReadableSectorTags = new List(), - ReadableMediaTags = new List(), + ReadableSectorTags = [], + ReadableMediaTags = [], HasPartitions = true, HasSessions = true, Version = null, diff --git a/Aaru.Images/CopyTape/Properties.cs b/Aaru.Images/CopyTape/Properties.cs index 0685a0450..f0be65b63 100644 --- a/Aaru.Images/CopyTape/Properties.cs +++ b/Aaru.Images/CopyTape/Properties.cs @@ -78,49 +78,46 @@ public sealed partial class CopyTape public bool IsTape { get; set; } /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.UnknownTape, MediaType.ADR2120, MediaType.ADR260, MediaType.ADR30, MediaType.ADR50, MediaType.AIT1, - MediaType.AIT1Turbo, MediaType.AIT2, MediaType.AIT2Turbo, MediaType.AIT3, MediaType.AIT3Ex, MediaType.AIT3Turbo, - MediaType.AIT4, MediaType.AIT5, MediaType.AITETurbo, MediaType.SAIT1, MediaType.SAIT2, MediaType.Ditto, - MediaType.DittoMax, MediaType.DigitalAudioTape, MediaType.DAT160, MediaType.DAT320, MediaType.DAT72, - MediaType.DDS1, MediaType.DDS2, MediaType.DDS3, MediaType.DDS4, MediaType.CompactTapeI, MediaType.CompactTapeII, - MediaType.DECtapeII, MediaType.DLTtapeIII, MediaType.DLTtapeIIIxt, MediaType.DLTtapeIV, MediaType.DLTtapeS4, - MediaType.SDLT1, MediaType.SDLT2, MediaType.VStapeI, MediaType.Exatape15m, MediaType.Exatape22m, - MediaType.Exatape22mAME, MediaType.Exatape28m, MediaType.Exatape40m, MediaType.Exatape45m, MediaType.Exatape54m, - MediaType.Exatape75m, MediaType.Exatape76m, MediaType.Exatape80m, MediaType.Exatape106m, - MediaType.Exatape160mXL, MediaType.Exatape112m, MediaType.Exatape125m, MediaType.Exatape150m, - MediaType.Exatape170m, MediaType.Exatape225m, MediaType.IBM3470, MediaType.IBM3480, MediaType.IBM3490, - MediaType.IBM3490E, MediaType.IBM3592, MediaType.LTO, MediaType.LTO2, MediaType.LTO3, MediaType.LTO3WORM, - MediaType.LTO4, MediaType.LTO4WORM, MediaType.LTO5, MediaType.LTO5WORM, MediaType.LTO6, MediaType.LTO6WORM, - MediaType.LTO7, MediaType.LTO7WORM, MediaType.MLR1, MediaType.MLR1SL, MediaType.MLR3, MediaType.SLR1, - MediaType.SLR2, MediaType.SLR3, MediaType.SLR32, MediaType.SLR32SL, MediaType.SLR4, MediaType.SLR5, - MediaType.SLR5SL, MediaType.SLR6, MediaType.SLRtape7, MediaType.SLRtape7SL, MediaType.SLRtape24, - MediaType.SLRtape24SL, MediaType.SLRtape40, MediaType.SLRtape50, MediaType.SLRtape60, MediaType.SLRtape75, - MediaType.SLRtape100, MediaType.SLRtape140, MediaType.QIC11, MediaType.QIC120, MediaType.QIC1350, - MediaType.QIC150, MediaType.QIC24, MediaType.QIC3010, MediaType.QIC3020, MediaType.QIC3080, MediaType.QIC3095, + public IEnumerable SupportedMediaTypes => + [ + MediaType.UnknownTape, MediaType.ADR2120, MediaType.ADR260, MediaType.ADR30, MediaType.ADR50, + MediaType.AIT1, MediaType.AIT1Turbo, MediaType.AIT2, MediaType.AIT2Turbo, MediaType.AIT3, MediaType.AIT3Ex, + MediaType.AIT3Turbo, MediaType.AIT4, MediaType.AIT5, MediaType.AITETurbo, MediaType.SAIT1, MediaType.SAIT2, + MediaType.Ditto, MediaType.DittoMax, MediaType.DigitalAudioTape, MediaType.DAT160, MediaType.DAT320, + MediaType.DAT72, MediaType.DDS1, MediaType.DDS2, MediaType.DDS3, MediaType.DDS4, MediaType.CompactTapeI, + MediaType.CompactTapeII, MediaType.DECtapeII, MediaType.DLTtapeIII, MediaType.DLTtapeIIIxt, + MediaType.DLTtapeIV, MediaType.DLTtapeS4, MediaType.SDLT1, MediaType.SDLT2, MediaType.VStapeI, + MediaType.Exatape15m, MediaType.Exatape22m, MediaType.Exatape22mAME, MediaType.Exatape28m, + MediaType.Exatape40m, MediaType.Exatape45m, MediaType.Exatape54m, MediaType.Exatape75m, + MediaType.Exatape76m, MediaType.Exatape80m, MediaType.Exatape106m, MediaType.Exatape160mXL, + MediaType.Exatape112m, MediaType.Exatape125m, MediaType.Exatape150m, MediaType.Exatape170m, + MediaType.Exatape225m, MediaType.IBM3470, MediaType.IBM3480, MediaType.IBM3490, MediaType.IBM3490E, + MediaType.IBM3592, MediaType.LTO, MediaType.LTO2, MediaType.LTO3, MediaType.LTO3WORM, MediaType.LTO4, + MediaType.LTO4WORM, MediaType.LTO5, MediaType.LTO5WORM, MediaType.LTO6, MediaType.LTO6WORM, MediaType.LTO7, + MediaType.LTO7WORM, MediaType.MLR1, MediaType.MLR1SL, MediaType.MLR3, MediaType.SLR1, MediaType.SLR2, + MediaType.SLR3, MediaType.SLR32, MediaType.SLR32SL, MediaType.SLR4, MediaType.SLR5, MediaType.SLR5SL, + MediaType.SLR6, MediaType.SLRtape7, MediaType.SLRtape7SL, MediaType.SLRtape24, MediaType.SLRtape24SL, + MediaType.SLRtape40, MediaType.SLRtape50, MediaType.SLRtape60, MediaType.SLRtape75, MediaType.SLRtape100, + MediaType.SLRtape140, MediaType.QIC11, MediaType.QIC120, MediaType.QIC1350, MediaType.QIC150, + MediaType.QIC24, MediaType.QIC3010, MediaType.QIC3020, MediaType.QIC3080, MediaType.QIC3095, MediaType.QIC320, MediaType.QIC40, MediaType.QIC525, MediaType.QIC80, MediaType.STK4480, MediaType.STK4490, MediaType.STK9490, MediaType.T9840A, MediaType.T9840B, MediaType.T9840C, MediaType.T9840D, MediaType.T9940A, - MediaType.T9940B, MediaType.T10000A, MediaType.T10000B, MediaType.T10000C, MediaType.T10000D, MediaType.Travan, - MediaType.Travan1Ex, MediaType.Travan3, MediaType.Travan3Ex, MediaType.Travan4, MediaType.Travan5, - MediaType.Travan7, MediaType.VXA1, MediaType.VXA2, MediaType.VXA3 - }; + MediaType.T9940B, MediaType.T10000A, MediaType.T10000B, MediaType.T10000C, MediaType.T10000D, + MediaType.Travan, MediaType.Travan1Ex, MediaType.Travan3, MediaType.Travan3Ex, MediaType.Travan4, + MediaType.Travan5, MediaType.Travan7, MediaType.VXA1, MediaType.VXA2, MediaType.VXA3 + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".cptp" - }; + public IEnumerable KnownExtensions => [".cptp"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/DiskCopy42/Properties.cs b/Aaru.Images/DiskCopy42/Properties.cs index ae73c44e3..bdb8a9405 100644 --- a/Aaru.Images/DiskCopy42/Properties.cs +++ b/Aaru.Images/DiskCopy42/Properties.cs @@ -65,32 +65,26 @@ public sealed partial class DiskCopy42 public string Format => Localization.DiskCopy42_Name; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => new[] - { - SectorTagType.AppleSonyTag - }; + public IEnumerable SupportedSectorTags => [SectorTagType.AppleSonyTag]; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.AppleFileWare, MediaType.AppleHD20, MediaType.AppleProfile, MediaType.AppleSonyDS, MediaType.AppleSonySS, MediaType.AppleWidget, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD, MediaType.DMF - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] - { - ("macosx", typeof(bool), Localization.Use_Mac_OS_X_format_byte, (object)false) - }; + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => + [ + ("macosx", typeof(bool), Localization.Use_Mac_OS_X_format_byte, false) + ]; /// - public IEnumerable KnownExtensions => new[] - { - ".dc42", ".diskcopy42", ".image" - }; + public IEnumerable KnownExtensions => [".dc42", ".diskcopy42", ".image"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/DriDiskCopy/Properties.cs b/Aaru.Images/DriDiskCopy/Properties.cs index 39a232566..67c9b9e1e 100644 --- a/Aaru.Images/DriDiskCopy/Properties.cs +++ b/Aaru.Images/DriDiskCopy/Properties.cs @@ -67,33 +67,29 @@ public sealed partial class DriDiskCopy public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; // TODO: Test with real hardware to see real supported media /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.ACORN_35_DS_DD, MediaType.ACORN_35_DS_HD, MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, MediaType.ATARI_35_DS_DD_11, MediaType.ATARI_35_SS_DD, MediaType.ATARI_35_SS_DD_11, MediaType.DMF, - MediaType.DMF_82, MediaType.DOS_35_DS_DD_8, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED, MediaType.DOS_35_HD, - MediaType.DOS_35_SS_DD_8, MediaType.DOS_35_SS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_DS_DD_9, - MediaType.DOS_525_HD, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, MediaType.FDFORMAT_35_DD, - MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, - MediaType.XDF_35, MediaType.XDF_525, MediaType.MetaFloppy_Mod_I, MediaType.MetaFloppy_Mod_II - }; + MediaType.DMF_82, MediaType.DOS_35_DS_DD_8, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED, + MediaType.DOS_35_HD, MediaType.DOS_35_SS_DD_8, MediaType.DOS_35_SS_DD_9, MediaType.DOS_525_DS_DD_8, + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, + MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, + MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525, MediaType.MetaFloppy_Mod_I, MediaType.MetaFloppy_Mod_II + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".dsk" - }; + public IEnumerable KnownExtensions => [".dsk"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/KryoFlux/Read.cs b/Aaru.Images/KryoFlux/Read.cs index b24448d22..3350fdd7c 100644 --- a/Aaru.Images/KryoFlux/Read.cs +++ b/Aaru.Images/KryoFlux/Read.cs @@ -166,11 +166,7 @@ public sealed partial class KryoFlux trackStream.EnsureRead(kfinfo, 0, oobBlk.length); string kfinfoStr = StringHandlers.CToString(kfinfo); - string[] lines = kfinfoStr.Split(new[] - { - ',' - }, - StringSplitOptions.RemoveEmptyEntries); + string[] lines = kfinfoStr.Split([','], StringSplitOptions.RemoveEmptyEntries); DateTime blockDate = DateTime.Now; DateTime blockTime = DateTime.Now; diff --git a/Aaru.Images/MaxiDisk/Properties.cs b/Aaru.Images/MaxiDisk/Properties.cs index 3429b096e..b0cd8f925 100644 --- a/Aaru.Images/MaxiDisk/Properties.cs +++ b/Aaru.Images/MaxiDisk/Properties.cs @@ -67,15 +67,15 @@ public sealed partial class MaxiDisk public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; // TODO: Test with real hardware to see real supported media /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, MediaType.ATARI_35_DS_DD_11, MediaType.ATARI_35_SS_DD, MediaType.ATARI_35_SS_DD_11, MediaType.DMF, MediaType.DMF_82, MediaType.DOS_35_DS_DD_8, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED, MediaType.DOS_35_HD, MediaType.DOS_35_SS_DD_8, @@ -83,17 +83,13 @@ public sealed partial class MaxiDisk MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525, MediaType.MetaFloppy_Mod_I, MediaType.MetaFloppy_Mod_II - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".hdk" - }; + public IEnumerable KnownExtensions => [".hdk"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/NHDr0/Properties.cs b/Aaru.Images/NHDr0/Properties.cs index aaf271965..91e505013 100644 --- a/Aaru.Images/NHDr0/Properties.cs +++ b/Aaru.Images/NHDr0/Properties.cs @@ -67,27 +67,20 @@ public sealed partial class Nhdr0 public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { - MediaType.GENERIC_HDD, MediaType.Unknown - }; + public IEnumerable SupportedMediaTypes => [MediaType.GENERIC_HDD, MediaType.Unknown]; // TODO: Support dynamic images /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".nhd" - }; + public IEnumerable KnownExtensions => [".nhd"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/Parallels/Properties.cs b/Aaru.Images/Parallels/Properties.cs index 66fc21dfa..ccf62aff2 100644 --- a/Aaru.Images/Parallels/Properties.cs +++ b/Aaru.Images/Parallels/Properties.cs @@ -67,29 +67,25 @@ public sealed partial class Parallels public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; // TODO: Add cluster size option /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".hdd" - }; + public IEnumerable KnownExtensions => [".hdd"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/QCOW/Properties.cs b/Aaru.Images/QCOW/Properties.cs index cdf1e5c5e..22e42e512 100644 --- a/Aaru.Images/QCOW/Properties.cs +++ b/Aaru.Images/QCOW/Properties.cs @@ -67,28 +67,24 @@ public sealed partial class Qcow public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".qcow", ".qc" - }; + public IEnumerable KnownExtensions => [".qcow", ".qc"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/QCOW2/Properties.cs b/Aaru.Images/QCOW2/Properties.cs index 63a51363d..2fc54c496 100644 --- a/Aaru.Images/QCOW2/Properties.cs +++ b/Aaru.Images/QCOW2/Properties.cs @@ -67,28 +67,24 @@ public sealed partial class Qcow2 public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".qcow2", ".qc2", ".qcow3", ".qc3" - }; + public IEnumerable KnownExtensions => [".qcow2", ".qc2", ".qcow3", ".qc3"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/QED/Properties.cs b/Aaru.Images/QED/Properties.cs index b31259708..d007865cb 100644 --- a/Aaru.Images/QED/Properties.cs +++ b/Aaru.Images/QED/Properties.cs @@ -67,29 +67,25 @@ public sealed partial class Qed public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; // TODO: Add cluster size option /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".qed" - }; + public IEnumerable KnownExtensions => [".qed"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/RayDIM/Properties.cs b/Aaru.Images/RayDIM/Properties.cs index 6bf289c41..917f56a6e 100644 --- a/Aaru.Images/RayDIM/Properties.cs +++ b/Aaru.Images/RayDIM/Properties.cs @@ -67,15 +67,15 @@ public sealed partial class RayDim public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; // TODO: Test with real hardware to see real supported media /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, MediaType.ATARI_35_DS_DD_11, MediaType.ATARI_35_SS_DD, MediaType.ATARI_35_SS_DD_11, MediaType.DMF, MediaType.DMF_82, MediaType.DOS_35_DS_DD_8, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED, MediaType.DOS_35_HD, MediaType.DOS_35_SS_DD_8, @@ -83,17 +83,13 @@ public sealed partial class RayDim MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525, MediaType.MetaFloppy_Mod_I, MediaType.MetaFloppy_Mod_II - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".dim" - }; + public IEnumerable KnownExtensions => [".dim"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/RsIde/Properties.cs b/Aaru.Images/RsIde/Properties.cs index 680f027e9..da3b037d3 100644 --- a/Aaru.Images/RsIde/Properties.cs +++ b/Aaru.Images/RsIde/Properties.cs @@ -67,31 +67,24 @@ public sealed partial class RsIde public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => new[] - { - MediaTagType.ATA_IDENTIFY - }; + public IEnumerable SupportedMediaTags => [MediaTagType.ATA_IDENTIFY]; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".ide" - }; + public IEnumerable KnownExtensions => [".ide"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/SaveDskF/Properties.cs b/Aaru.Images/SaveDskF/Properties.cs index 57a1ffe2c..a278b3eef 100644 --- a/Aaru.Images/SaveDskF/Properties.cs +++ b/Aaru.Images/SaveDskF/Properties.cs @@ -67,33 +67,29 @@ public sealed partial class SaveDskF public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; // TODO: Test with real hardware to see real supported media /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.ACORN_35_DS_DD, MediaType.ACORN_35_DS_HD, MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, MediaType.ATARI_35_DS_DD_11, MediaType.ATARI_35_SS_DD, MediaType.ATARI_35_SS_DD_11, MediaType.DMF, - MediaType.DMF_82, MediaType.DOS_35_DS_DD_8, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED, MediaType.DOS_35_HD, - MediaType.DOS_35_SS_DD_8, MediaType.DOS_35_SS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_DS_DD_9, - MediaType.DOS_525_HD, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, MediaType.FDFORMAT_35_DD, - MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, - MediaType.XDF_35, MediaType.XDF_525, MediaType.MetaFloppy_Mod_I, MediaType.MetaFloppy_Mod_II - }; + MediaType.DMF_82, MediaType.DOS_35_DS_DD_8, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED, + MediaType.DOS_35_HD, MediaType.DOS_35_SS_DD_8, MediaType.DOS_35_SS_DD_9, MediaType.DOS_525_DS_DD_8, + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, + MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, + MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525, MediaType.MetaFloppy_Mod_I, MediaType.MetaFloppy_Mod_II + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".dsk" - }; + public IEnumerable KnownExtensions => [".dsk"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/SuperCardPro/Properties.cs b/Aaru.Images/SuperCardPro/Properties.cs index 707833795..781eadadb 100644 --- a/Aaru.Images/SuperCardPro/Properties.cs +++ b/Aaru.Images/SuperCardPro/Properties.cs @@ -86,25 +86,21 @@ public sealed partial class SuperCardPro public IEnumerable SupportedMediaTags => null; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ // TODO: SCP supports a lot more formats, please add more whence tested. MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD, MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.Unknown - }; + ]; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".scp" - }; + public IEnumerable KnownExtensions => [".scp"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/T98/Properties.cs b/Aaru.Images/T98/Properties.cs index 0a098b5d7..17e7878c9 100644 --- a/Aaru.Images/T98/Properties.cs +++ b/Aaru.Images/T98/Properties.cs @@ -69,28 +69,24 @@ public sealed partial class T98 public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".t98" - }; + public IEnumerable KnownExtensions => [".t98"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/UDIF/Properties.cs b/Aaru.Images/UDIF/Properties.cs index 8ca3b43ec..487984a65 100644 --- a/Aaru.Images/UDIF/Properties.cs +++ b/Aaru.Images/UDIF/Properties.cs @@ -67,28 +67,24 @@ public sealed partial class Udif public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".dmg" - }; + public IEnumerable KnownExtensions => [".dmg"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/VDI/Properties.cs b/Aaru.Images/VDI/Properties.cs index 69805c5db..d679f1566 100644 --- a/Aaru.Images/VDI/Properties.cs +++ b/Aaru.Images/VDI/Properties.cs @@ -67,29 +67,25 @@ public sealed partial class Vdi public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; // TODO: Add cluster size option /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".vdi" - }; + public IEnumerable KnownExtensions => [".vdi"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/VHD/Properties.cs b/Aaru.Images/VHD/Properties.cs index a5427c704..7911c7b8b 100644 --- a/Aaru.Images/VHD/Properties.cs +++ b/Aaru.Images/VHD/Properties.cs @@ -73,31 +73,28 @@ public sealed partial class Vhd public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] - { - ("dynamic", typeof(bool), Localization.Create_a_dynamic_image, (object)true), + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => + [ + ("dynamic", typeof(bool), Localization.Create_a_dynamic_image, true), ("block_size", typeof(uint), Localization.Vhd_Block_size_Must_be_a_power_of_2, 2097152) - }; + ]; /// - public IEnumerable KnownExtensions => new[] - { - ".vhd" - }; + public IEnumerable KnownExtensions => [".vhd"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/VMware/Properties.cs b/Aaru.Images/VMware/Properties.cs index 6d4a75077..4f3cf8b33 100644 --- a/Aaru.Images/VMware/Properties.cs +++ b/Aaru.Images/VMware/Properties.cs @@ -67,33 +67,30 @@ public sealed partial class VMware public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] - { + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => + [ ("adapter_type", typeof(string), Localization.Name_of_adapter_type, "ide"), ("hwversion", typeof(uint), Localization.VDMK_hardware_version, 4), ("sparse", typeof(bool), Localization.VMware_SupportedOptions_Use_sparse_extents, false), - ("split", typeof(bool), Localization.Split_data_file_at_2GiB, (object)false) - }; + ("split", typeof(bool), Localization.Split_data_file_at_2GiB, false) + ]; /// - public IEnumerable KnownExtensions => new[] - { - ".vmdk" - }; + public IEnumerable KnownExtensions => [".vmdk"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/Virtual98/Properties.cs b/Aaru.Images/Virtual98/Properties.cs index 395df4c65..e0c640bb6 100644 --- a/Aaru.Images/Virtual98/Properties.cs +++ b/Aaru.Images/Virtual98/Properties.cs @@ -67,28 +67,24 @@ public sealed partial class Virtual98 public Metadata AaruMetadata => null; /// - public IEnumerable SupportedMediaTags => Array.Empty(); + public IEnumerable SupportedMediaTags => []; /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// - public IEnumerable SupportedMediaTypes => new[] - { + public IEnumerable SupportedMediaTypes => + [ MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV - }; + ]; /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".v98" - }; + public IEnumerable KnownExtensions => [".v98"]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Images/ZZZRawImage/Properties.cs b/Aaru.Images/ZZZRawImage/Properties.cs index 53153a23e..52d743d36 100644 --- a/Aaru.Images/ZZZRawImage/Properties.cs +++ b/Aaru.Images/ZZZRawImage/Properties.cs @@ -174,7 +174,7 @@ public sealed partial class ZZZRawImage .ToArray(); /// - public IEnumerable SupportedSectorTags => Array.Empty(); + public IEnumerable SupportedSectorTags => []; /// public IEnumerable SupportedMediaTypes @@ -217,15 +217,14 @@ public sealed partial class ZZZRawImage } /// - public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - Array.Empty<(string name, Type type, string description, object @default)>(); + public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => []; /// - public IEnumerable KnownExtensions => new[] - { - ".adf", ".adl", ".d81", ".dsk", ".hdf", ".ima", ".img", ".iso", ".ssd", ".st", ".1kn", ".2kn", ".4kn", ".8kn", - ".16kn", ".32kn", ".64kn", ".512e", ".512", ".128", ".256" - }; + public IEnumerable KnownExtensions => + [ + ".adf", ".adl", ".d81", ".dsk", ".hdf", ".ima", ".img", ".iso", ".ssd", ".st", ".1kn", ".2kn", ".4kn", + ".8kn", ".16kn", ".32kn", ".64kn", ".512e", ".512", ".128", ".256" + ]; /// public bool IsWriting { get; private set; } diff --git a/Aaru.Tests/Images/BlockMediaImageTest.cs b/Aaru.Tests/Images/BlockMediaImageTest.cs index bd0c739c3..61d906c5b 100644 --- a/Aaru.Tests/Images/BlockMediaImageTest.cs +++ b/Aaru.Tests/Images/BlockMediaImageTest.cs @@ -327,7 +327,7 @@ public abstract class BlockMediaImageTest : BaseMediaImageTest while(currentLevel.Count > 0) { currentDepth++; - List nextLevels = new(); + List nextLevels = []; foreach(ReadOnlyFilesystemTest.NextLevel subLevel in currentLevel) { diff --git a/Aaru.Tests/Images/OpticalMediaImageTest.cs b/Aaru.Tests/Images/OpticalMediaImageTest.cs index 01a127e44..8d2eddbe4 100644 --- a/Aaru.Tests/Images/OpticalMediaImageTest.cs +++ b/Aaru.Tests/Images/OpticalMediaImageTest.cs @@ -333,7 +333,7 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest while(currentLevel.Count > 0) { currentDepth++; - List nextLevels = new(); + List nextLevels = []; foreach(ReadOnlyFilesystemTest.NextLevel subLevel in currentLevel) { diff --git a/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs b/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs index 234907dbb..8a0e356c3 100644 --- a/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs +++ b/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs @@ -188,11 +188,7 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest inputFormat.Info.MediaType, testFile)); - bool useLong = inputFormat.Info.ReadableSectorTags.Except(new[] - { - SectorTagType.CdTrackFlags - }) - .Any(); + bool useLong = inputFormat.Info.ReadableSectorTags.Except([SectorTagType.CdTrackFlags]).Any(); // TODO: Can be done with LINQ only foreach(SectorTagType unused in inputFormat.Info.ReadableSectorTags