mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Refactor] Use collection expressions.
This commit is contained in:
@@ -94,53 +94,53 @@ public class Metadata
|
||||
|
||||
var metadata = new Metadata
|
||||
{
|
||||
Developers = cicm.Developer is null ? null : new List<string>(cicm.Developer),
|
||||
Publishers = cicm.Publisher is null ? null : new List<string>(cicm.Publisher),
|
||||
Authors = cicm.Author is null ? null : new List<string>(cicm.Author),
|
||||
Performers = cicm.Performer is null ? null : new List<string>(cicm.Performer),
|
||||
Developers = cicm.Developer is null ? null : [..cicm.Developer],
|
||||
Publishers = cicm.Publisher is null ? null : [..cicm.Publisher],
|
||||
Authors = cicm.Author is null ? null : [..cicm.Author],
|
||||
Performers = cicm.Performer is null ? null : [..cicm.Performer],
|
||||
Name = cicm.Name,
|
||||
Version = cicm.Version,
|
||||
Release = cicm.ReleaseTypeSpecified ? (ReleaseType)cicm.ReleaseType : null,
|
||||
ReleaseDate = cicm.ReleaseDateSpecified ? cicm.ReleaseDate : null,
|
||||
PartNumber = cicm.PartNumber,
|
||||
SerialNumber = cicm.SerialNumber,
|
||||
Keywords = cicm.Keywords is null ? null : new List<string>(cicm.Keywords),
|
||||
Categories = cicm.Categories is null ? null : new List<string>(cicm.Categories),
|
||||
Subcategories = cicm.Subcategories is null ? null : new List<string>(cicm.Subcategories),
|
||||
Systems = cicm.Systems is null ? null : new List<string>(cicm.Systems)
|
||||
Keywords = cicm.Keywords is null ? null : [..cicm.Keywords],
|
||||
Categories = cicm.Categories is null ? null : [..cicm.Categories],
|
||||
Subcategories = cicm.Subcategories is null ? null : [..cicm.Subcategories],
|
||||
Systems = cicm.Systems is null ? null : [..cicm.Systems]
|
||||
};
|
||||
|
||||
if(cicm.Barcodes is not null)
|
||||
{
|
||||
metadata.Barcodes = new List<Barcode>();
|
||||
metadata.Barcodes = [];
|
||||
|
||||
foreach(Schemas.BarcodeType code in cicm.Barcodes) metadata.Barcodes.Add(code);
|
||||
}
|
||||
|
||||
if(cicm.Magazine is not null)
|
||||
{
|
||||
metadata.Magazines = new List<Magazine>();
|
||||
metadata.Magazines = [];
|
||||
|
||||
foreach(MagazineType magazine in cicm.Magazine) metadata.Magazines.Add(magazine);
|
||||
}
|
||||
|
||||
if(cicm.Book is not null)
|
||||
{
|
||||
metadata.Books = new List<Book>();
|
||||
metadata.Books = [];
|
||||
|
||||
foreach(BookType book in cicm.Book) metadata.Books.Add(book);
|
||||
}
|
||||
|
||||
if(cicm.Languages is not null)
|
||||
{
|
||||
metadata.Languages = new List<Language>();
|
||||
metadata.Languages = [];
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Languages) metadata.Languages.Add((Language)lng);
|
||||
}
|
||||
|
||||
if(cicm.Architectures is not null)
|
||||
{
|
||||
metadata.Architectures = new List<Architecture>();
|
||||
metadata.Architectures = [];
|
||||
|
||||
foreach(ArchitecturesTypeArchitecture arch in cicm.Architectures)
|
||||
metadata.Architectures.Add((Architecture)arch);
|
||||
@@ -148,7 +148,7 @@ public class Metadata
|
||||
|
||||
if(cicm.RequiredOperatingSystems is not null)
|
||||
{
|
||||
metadata.RequiredOperatingSystems = new List<RequiredOperatingSystem>();
|
||||
metadata.RequiredOperatingSystems = [];
|
||||
|
||||
foreach(RequiredOperatingSystemType os in cicm.RequiredOperatingSystems)
|
||||
metadata.RequiredOperatingSystems.Add(os);
|
||||
@@ -156,49 +156,49 @@ public class Metadata
|
||||
|
||||
if(cicm.UserManual is not null)
|
||||
{
|
||||
metadata.UserManuals = new List<UserManual>();
|
||||
metadata.UserManuals = [];
|
||||
|
||||
foreach(UserManualType manual in cicm.UserManual) metadata.UserManuals.Add(manual);
|
||||
}
|
||||
|
||||
if(cicm.OpticalDisc is not null)
|
||||
{
|
||||
metadata.OpticalDiscs = new List<OpticalDisc>();
|
||||
metadata.OpticalDiscs = [];
|
||||
|
||||
foreach(OpticalDiscType disc in cicm.OpticalDisc) metadata.OpticalDiscs.Add(disc);
|
||||
}
|
||||
|
||||
if(cicm.Advertisement is not null)
|
||||
{
|
||||
metadata.Advertisements = new List<Advertisement>();
|
||||
metadata.Advertisements = [];
|
||||
|
||||
foreach(AdvertisementType adv in cicm.Advertisement) metadata.Advertisements.Add(adv);
|
||||
}
|
||||
|
||||
if(cicm.LinearMedia is not null)
|
||||
{
|
||||
metadata.LinearMedias = new List<LinearMedia>();
|
||||
metadata.LinearMedias = [];
|
||||
|
||||
foreach(LinearMediaType media in cicm.LinearMedia) metadata.LinearMedias.Add(media);
|
||||
}
|
||||
|
||||
if(cicm.PCICard is not null)
|
||||
{
|
||||
metadata.PciCards = new List<Pci>();
|
||||
metadata.PciCards = [];
|
||||
|
||||
foreach(PCIType pci in cicm.PCICard) metadata.PciCards.Add(pci);
|
||||
}
|
||||
|
||||
if(cicm.BlockMedia is not null)
|
||||
{
|
||||
metadata.BlockMedias = new List<BlockMedia>();
|
||||
metadata.BlockMedias = [];
|
||||
|
||||
foreach(BlockMediaType media in cicm.BlockMedia) metadata.BlockMedias.Add(media);
|
||||
}
|
||||
|
||||
if(cicm.AudioMedia is null) return metadata;
|
||||
|
||||
metadata.AudioMedias = new List<AudioMedia>();
|
||||
metadata.AudioMedias = [];
|
||||
|
||||
foreach(AudioMediaType media in cicm.AudioMedia) metadata.AudioMedias.Add(media);
|
||||
|
||||
|
||||
@@ -79,21 +79,21 @@ public class Advertisement
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
adv.Checksums = new List<Checksum>();
|
||||
adv.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) adv.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.AudioTrack is not null)
|
||||
{
|
||||
adv.AudioTracks = new List<AudioTrack>();
|
||||
adv.AudioTracks = [];
|
||||
|
||||
foreach(AudioTracksType trk in cicm.AudioTrack) adv.AudioTracks.Add(trk);
|
||||
}
|
||||
|
||||
if(cicm.VideoTrack is not null)
|
||||
{
|
||||
adv.VideoTracks = new List<VideoTrack>();
|
||||
adv.VideoTracks = [];
|
||||
|
||||
foreach(VideoTracksType trk in cicm.VideoTrack) adv.VideoTracks.Add(trk);
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class Advertisement
|
||||
if(cicm.SubtitleTrack is null) return adv;
|
||||
|
||||
{
|
||||
adv.SubtitleTracks = new List<SubtitleTrack>();
|
||||
adv.SubtitleTracks = [];
|
||||
|
||||
foreach(SubtitleTracksType trk in cicm.SubtitleTrack) adv.SubtitleTracks.Add(trk);
|
||||
}
|
||||
|
||||
@@ -84,21 +84,21 @@ public class AudioMedia
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
media.Checksums = new List<Checksum>();
|
||||
media.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) media.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.Block is not null)
|
||||
{
|
||||
media.Blocks = new List<AudioBlock>();
|
||||
media.Blocks = [];
|
||||
|
||||
foreach(AudioBlockType blk in cicm.Block) media.Blocks.Add(blk);
|
||||
}
|
||||
|
||||
if(cicm.DumpHardwareArray is null) return media;
|
||||
|
||||
media.DumpHardware = new List<DumpHardware>();
|
||||
media.DumpHardware = [];
|
||||
|
||||
foreach(DumpHardwareType hw in cicm.DumpHardwareArray) media.DumpHardware.Add(hw);
|
||||
|
||||
@@ -129,7 +129,7 @@ public class AudioBlock
|
||||
|
||||
if(cicm.Checksums is null) return blk;
|
||||
|
||||
blk.Checksums = new List<Checksum>();
|
||||
blk.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) blk.Checksums.Add(chk);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class AudioTrack
|
||||
|
||||
if(cicm.Languages is null) return trk;
|
||||
|
||||
trk.Languages = new List<Language>();
|
||||
trk.Languages = [];
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Languages) trk.Languages.Add((Language)lng);
|
||||
|
||||
@@ -111,7 +111,7 @@ public class VideoTrack
|
||||
|
||||
if(cicm.Languages is null) return trk;
|
||||
|
||||
trk.Languages = new List<Language>();
|
||||
trk.Languages = [];
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Languages) trk.Languages.Add((Language)lng);
|
||||
|
||||
@@ -138,7 +138,7 @@ public class SubtitleTrack
|
||||
|
||||
if(cicm.Languages is null) return sub;
|
||||
|
||||
sub.Languages = new List<Language>();
|
||||
sub.Languages = [];
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Languages) sub.Languages.Add((Language)lng);
|
||||
|
||||
@@ -171,7 +171,7 @@ public class Recording
|
||||
|
||||
if(cicm.Software is null) return recording;
|
||||
|
||||
recording.Software = new List<Software>();
|
||||
recording.Software = [];
|
||||
|
||||
foreach(SoftwareType sw in cicm.Software) recording.Software.Add(sw);
|
||||
|
||||
|
||||
@@ -124,28 +124,28 @@ public class BlockMedia
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
media.Checksums = new List<Checksum>();
|
||||
media.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) media.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.ContentChecksums is not null)
|
||||
{
|
||||
media.ContentChecksums = new List<Checksum>();
|
||||
media.ContentChecksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.ContentChecksums) media.ContentChecksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.VariableBlockSize is not null)
|
||||
{
|
||||
media.VariableBlockSize = new List<BlockSize>();
|
||||
media.VariableBlockSize = [];
|
||||
|
||||
foreach(BlockSizeType blkSize in cicm.VariableBlockSize) media.VariableBlockSize.Add(blkSize);
|
||||
}
|
||||
|
||||
if(cicm.TapeInformation is not null)
|
||||
{
|
||||
media.TapeInformation = new List<TapePartition>();
|
||||
media.TapeInformation = [];
|
||||
|
||||
foreach(TapePartitionType tapeInformation in cicm.TapeInformation)
|
||||
media.TapeInformation.Add(tapeInformation);
|
||||
@@ -153,14 +153,14 @@ public class BlockMedia
|
||||
|
||||
if(cicm.FileSystemInformation is not null)
|
||||
{
|
||||
media.FileSystemInformation = new List<Partition>();
|
||||
media.FileSystemInformation = [];
|
||||
|
||||
foreach(PartitionType fsInfo in cicm.FileSystemInformation) media.FileSystemInformation.Add(fsInfo);
|
||||
}
|
||||
|
||||
if(cicm.DumpHardwareArray is null) return media;
|
||||
|
||||
media.DumpHardware = new List<DumpHardware>();
|
||||
media.DumpHardware = [];
|
||||
|
||||
foreach(DumpHardwareType hw in cicm.DumpHardwareArray) media.DumpHardware.Add(hw);
|
||||
|
||||
@@ -201,7 +201,7 @@ public class BlockTrack
|
||||
|
||||
if(cicm.Checksums is null) return trk;
|
||||
|
||||
trk.Checksums = new List<Checksum>();
|
||||
trk.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) trk.Checksums.Add(chk);
|
||||
|
||||
|
||||
@@ -77,14 +77,14 @@ public class Book
|
||||
|
||||
if(cicm.Barcodes is not null)
|
||||
{
|
||||
book.Barcodes = new List<Barcode>();
|
||||
book.Barcodes = [];
|
||||
|
||||
foreach(Schemas.BarcodeType code in cicm.Barcodes) book.Barcodes.Add(code);
|
||||
}
|
||||
|
||||
if(cicm.Language is null) return book;
|
||||
|
||||
book.Languages = new List<Language>();
|
||||
book.Languages = [];
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Language) book.Languages.Add((Language)lng);
|
||||
|
||||
|
||||
@@ -63,14 +63,14 @@ public class FilesystemContents
|
||||
|
||||
if(cicm.File is not null)
|
||||
{
|
||||
fs.Files = new List<ContentsFile>();
|
||||
fs.Files = [];
|
||||
|
||||
foreach(ContentsFileType file in cicm.File) fs.Files.Add(file);
|
||||
}
|
||||
|
||||
if(cicm.Directory is null) return fs;
|
||||
|
||||
fs.Directories = new List<Directory>();
|
||||
fs.Directories = [];
|
||||
|
||||
foreach(DirectoryType dir in cicm.Directory) fs.Directories.Add(dir);
|
||||
|
||||
@@ -122,14 +122,14 @@ public class ContentsFile
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
file.Checksums = new List<Checksum>();
|
||||
file.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) file.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.ExtendedAttributes is null) return file;
|
||||
|
||||
file.ExtendedAttributes = new List<ExtendedAttribute>();
|
||||
file.ExtendedAttributes = [];
|
||||
|
||||
foreach(ExtendedAttributeType xa in cicm.ExtendedAttributes) file.ExtendedAttributes.Add(xa);
|
||||
|
||||
@@ -156,7 +156,7 @@ public class ExtendedAttribute
|
||||
|
||||
if(cicm.Checksums is null) return xa;
|
||||
|
||||
xa.Checksums = new List<Checksum>();
|
||||
xa.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) xa.Checksums.Add(chk);
|
||||
|
||||
@@ -206,14 +206,14 @@ public class Directory
|
||||
|
||||
if(cicm.Directory is not null)
|
||||
{
|
||||
dir.Directories = new List<Directory>();
|
||||
dir.Directories = [];
|
||||
|
||||
foreach(DirectoryType d in cicm.Directory) dir.Directories.Add(d);
|
||||
}
|
||||
|
||||
if(cicm.File is null) return dir;
|
||||
|
||||
dir.Files = new List<ContentsFile>();
|
||||
dir.Files = [];
|
||||
|
||||
foreach(ContentsFileType file in cicm.File) dir.Files.Add(file);
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public class Dump
|
||||
|
||||
if(cicm.Checksums is null) return dump;
|
||||
|
||||
dump.Checksums = new List<Checksum>();
|
||||
dump.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) dump.Checksums.Add(chk);
|
||||
|
||||
@@ -110,7 +110,7 @@ public class Border
|
||||
|
||||
if(cicm.Checksums is null) return border;
|
||||
|
||||
border.Checksums = new List<Checksum>();
|
||||
border.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) border.Checksums.Add(chk);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class DumpHardware
|
||||
|
||||
if(cicm.Extents is null) return hw;
|
||||
|
||||
hw.Extents = new List<Extent>();
|
||||
hw.Extents = [];
|
||||
|
||||
foreach(ExtentType ext in cicm.Extents) hw.Extents.Add(ext);
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class Layers
|
||||
|
||||
if(cicm.Sectors is null) return layers;
|
||||
|
||||
layers.Sectors = new List<Sectors>();
|
||||
layers.Sectors = [];
|
||||
|
||||
foreach(SectorsType sec in cicm.Sectors) layers.Sectors.Add(sec);
|
||||
|
||||
|
||||
@@ -94,21 +94,21 @@ public class LinearMedia
|
||||
|
||||
if(cicm.ImageChecksums is not null)
|
||||
{
|
||||
linearMedia.ImageChecksums = new List<Checksum>();
|
||||
linearMedia.ImageChecksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.ImageChecksums) linearMedia.ImageChecksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
linearMedia.Checksums = new List<Checksum>();
|
||||
linearMedia.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) linearMedia.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.DumpHardwareArray is null) return linearMedia;
|
||||
|
||||
linearMedia.DumpHardware = new List<DumpHardware>();
|
||||
linearMedia.DumpHardware = [];
|
||||
|
||||
foreach(DumpHardwareType hw in cicm.DumpHardwareArray) linearMedia.DumpHardware.Add(hw);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public class Magazine
|
||||
|
||||
if(cicm.Barcodes is not null)
|
||||
{
|
||||
magazine.Barcodes = new List<Barcode>();
|
||||
magazine.Barcodes = [];
|
||||
|
||||
foreach(Schemas.BarcodeType code in cicm.Barcodes) magazine.Barcodes.Add(code);
|
||||
}
|
||||
|
||||
@@ -142,77 +142,77 @@ public class OpticalDisc
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
disc.Checksums = new List<Checksum>();
|
||||
disc.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) disc.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.RingCode is not null)
|
||||
{
|
||||
disc.RingCode = new List<LayeredText>();
|
||||
disc.RingCode = [];
|
||||
|
||||
foreach(LayeredTextType lt in cicm.RingCode) disc.RingCode.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.MasteringSID is not null)
|
||||
{
|
||||
disc.MasteringSid = new List<LayeredText>();
|
||||
disc.MasteringSid = [];
|
||||
|
||||
foreach(LayeredTextType lt in cicm.MasteringSID) disc.MasteringSid.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.Toolstamp is not null)
|
||||
{
|
||||
disc.Toolstamp = new List<LayeredText>();
|
||||
disc.Toolstamp = [];
|
||||
|
||||
foreach(LayeredTextType lt in cicm.Toolstamp) disc.Toolstamp.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.MouldSID is not null)
|
||||
{
|
||||
disc.MouldSid = new List<LayeredText>();
|
||||
disc.MouldSid = [];
|
||||
|
||||
foreach(LayeredTextType lt in cicm.MouldSID) disc.MouldSid.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.MouldText is not null)
|
||||
{
|
||||
disc.MouldText = new List<LayeredText>();
|
||||
disc.MouldText = [];
|
||||
|
||||
foreach(LayeredTextType lt in cicm.MouldText) disc.MouldText.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.FirstTrackPregrap is not null)
|
||||
{
|
||||
disc.FirstTrackPregrap = new List<Border>();
|
||||
disc.FirstTrackPregrap = [];
|
||||
|
||||
foreach(BorderType lt in cicm.FirstTrackPregrap) disc.FirstTrackPregrap.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.LeadIn is not null)
|
||||
{
|
||||
disc.LeadIn = new List<Border>();
|
||||
disc.LeadIn = [];
|
||||
|
||||
foreach(BorderType lt in cicm.LeadIn) disc.LeadIn.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.LeadOut is not null)
|
||||
{
|
||||
disc.LeadOut = new List<Border>();
|
||||
disc.LeadOut = [];
|
||||
|
||||
foreach(BorderType lt in cicm.LeadOut) disc.LeadOut.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.Track is not null)
|
||||
{
|
||||
disc.Track = new List<Track>();
|
||||
disc.Track = [];
|
||||
|
||||
foreach(Schemas.TrackType lt in cicm.Track) disc.Track.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.DumpHardwareArray is null) return disc;
|
||||
|
||||
disc.DumpHardware = new List<DumpHardware>();
|
||||
disc.DumpHardware = [];
|
||||
|
||||
foreach(DumpHardwareType hw in cicm.DumpHardwareArray) disc.DumpHardware.Add(hw);
|
||||
|
||||
@@ -263,21 +263,21 @@ public class Track
|
||||
|
||||
if(cicm.Indexes is not null)
|
||||
{
|
||||
trk.Indexes = new List<TrackIndex>();
|
||||
trk.Indexes = [];
|
||||
|
||||
foreach(TrackIndexType idx in cicm.Indexes) trk.Indexes.Add(idx);
|
||||
}
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
trk.Checksums = new List<Checksum>();
|
||||
trk.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) trk.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.FileSystemInformation is null) return trk;
|
||||
|
||||
trk.FileSystemInformation = new List<Partition>();
|
||||
trk.FileSystemInformation = [];
|
||||
|
||||
foreach(PartitionType fs in cicm.FileSystemInformation) trk.FileSystemInformation.Add(fs);
|
||||
|
||||
@@ -368,7 +368,7 @@ public class SubChannel
|
||||
|
||||
if(cicm.Checksums is null) return subchannel;
|
||||
|
||||
subchannel.Checksums = new List<Checksum>();
|
||||
subchannel.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) subchannel.Checksums.Add(chk);
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ public class Pcmcia
|
||||
AdditionalInformation =
|
||||
cicm.AdditionalInformation is null
|
||||
? null
|
||||
: new List<string>(cicm
|
||||
.AdditionalInformation)
|
||||
: [..cicm.AdditionalInformation]
|
||||
};
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class Partition
|
||||
|
||||
if(cicm.FileSystems is null) return part;
|
||||
|
||||
part.FileSystems = new List<FileSystem>();
|
||||
part.FileSystems = [];
|
||||
|
||||
foreach(FileSystemType fs in cicm.FileSystems) part.FileSystems.Add(fs);
|
||||
|
||||
|
||||
@@ -56,6 +56,6 @@ public class RequiredOperatingSystem
|
||||
: new RequiredOperatingSystem
|
||||
{
|
||||
Name = cicm.Name,
|
||||
Versions = cicm.Version is null ? null : new List<string>(cicm.Version)
|
||||
Versions = cicm.Version is null ? null : [..cicm.Version]
|
||||
};
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class SCSI
|
||||
|
||||
if(cicm.EVPD is null) return cicm;
|
||||
|
||||
scsi.Evpds = new List<Evpd>();
|
||||
scsi.Evpds = [];
|
||||
|
||||
foreach(EVPDType evpd in cicm.EVPD) scsi.Evpds.Add(evpd);
|
||||
|
||||
@@ -97,7 +97,7 @@ public class Evpd
|
||||
|
||||
if(cicm.Checksums is null) return evpd;
|
||||
|
||||
evpd.Checksums = new List<Checksum>();
|
||||
evpd.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) evpd.Checksums.Add(chk);
|
||||
|
||||
|
||||
@@ -66,28 +66,28 @@ public class Scan
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
scan.Checksums = new List<Checksum>();
|
||||
scan.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) scan.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.Scanner is not null)
|
||||
{
|
||||
scan.Scanner = new List<Scanner>();
|
||||
scan.Scanner = [];
|
||||
|
||||
foreach(ScannerType scanner in cicm.Scanner) scan.Scanner.Add(scanner);
|
||||
}
|
||||
|
||||
if(cicm.ScanProcessing is not null)
|
||||
{
|
||||
scan.ScanProcessing = new List<ScanProcessing>();
|
||||
scan.ScanProcessing = [];
|
||||
|
||||
foreach(ScanProcessingType processing in cicm.ScanProcessing) scan.ScanProcessing.Add(processing);
|
||||
}
|
||||
|
||||
if(cicm.OCR is null) return scan;
|
||||
|
||||
scan.OCR = new List<OCR>();
|
||||
scan.OCR = [];
|
||||
|
||||
foreach(OCRType ocr in cicm.OCR) scan.OCR.Add(ocr);
|
||||
|
||||
@@ -114,7 +114,7 @@ public class Cover
|
||||
|
||||
if(cicm.Checksums is null) return cover;
|
||||
|
||||
cover.Checksums = new List<Checksum>();
|
||||
cover.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) cover.Checksums.Add(chk);
|
||||
|
||||
@@ -303,7 +303,7 @@ public class OCR
|
||||
|
||||
if(cicm.Language is null) return ocr;
|
||||
|
||||
ocr.Language = new List<Language>();
|
||||
ocr.Language = [];
|
||||
|
||||
foreach(Language lng in cicm.Language) ocr.Language.Add(lng);
|
||||
|
||||
|
||||
@@ -71,14 +71,14 @@ public class TapePartition
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
partition.Checksums = new List<Checksum>();
|
||||
partition.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) partition.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.File is null) return partition;
|
||||
|
||||
partition.Files = new List<TapeFile>();
|
||||
partition.Files = [];
|
||||
|
||||
foreach(TapeFileType file in cicm.File) partition.Files.Add(file);
|
||||
|
||||
@@ -113,7 +113,7 @@ public class TapeFile
|
||||
|
||||
if(cicm.Checksums is null) return file;
|
||||
|
||||
file.Checksums = new List<Checksum>();
|
||||
file.Checksums = [];
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums) file.Checksums.Add(chk);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public class UserManual
|
||||
|
||||
if(cicm.Language is null) return manual;
|
||||
|
||||
manual.Language = new List<Language>();
|
||||
manual.Language = [];
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Language) manual.Language.Add((Language)lng);
|
||||
|
||||
|
||||
@@ -52,13 +52,13 @@ public sealed class ExtentsByte
|
||||
List<Tuple<byte, byte>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsByte() => _backend = new List<Tuple<byte, byte>>();
|
||||
public ExtentsByte() => _backend = [];
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsByte(IEnumerable<Tuple<byte, byte>> list)
|
||||
{
|
||||
_backend = new List<Tuple<byte, byte>>();
|
||||
_backend = [];
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<byte, byte> t in list) Add(t.Item1, t.Item2);
|
||||
|
||||
@@ -54,7 +54,7 @@ public static class ExtentsConverter
|
||||
if(extents == null) return null;
|
||||
|
||||
Tuple<ulong, ulong>[] tuples = extents.ToArray();
|
||||
List<Extent> list = new();
|
||||
List<Extent> list = [];
|
||||
|
||||
for(ulong i = 0; i < (ulong)tuples.LongLength; i++)
|
||||
{
|
||||
|
||||
@@ -52,13 +52,13 @@ public sealed class ExtentsInt
|
||||
List<Tuple<int, int>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsInt() => _backend = new List<Tuple<int, int>>();
|
||||
public ExtentsInt() => _backend = [];
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsInt(IEnumerable<Tuple<int, int>> list)
|
||||
{
|
||||
_backend = new List<Tuple<int, int>>();
|
||||
_backend = [];
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<int, int> t in list) Add(t.Item1, t.Item2);
|
||||
|
||||
@@ -51,13 +51,13 @@ public sealed class ExtentsLong
|
||||
List<Tuple<long, long>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsLong() => _backend = new List<Tuple<long, long>>();
|
||||
public ExtentsLong() => _backend = [];
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsLong(IEnumerable<Tuple<long, long>> list)
|
||||
{
|
||||
_backend = new List<Tuple<long, long>>();
|
||||
_backend = [];
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<long, long> t in list) Add(t.Item1, t.Item2);
|
||||
|
||||
@@ -52,13 +52,13 @@ public sealed class ExtentsSByte
|
||||
List<Tuple<sbyte, sbyte>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsSByte() => _backend = new List<Tuple<sbyte, sbyte>>();
|
||||
public ExtentsSByte() => _backend = [];
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsSByte(IEnumerable<Tuple<sbyte, sbyte>> list)
|
||||
{
|
||||
_backend = new List<Tuple<sbyte, sbyte>>();
|
||||
_backend = [];
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<sbyte, sbyte> t in list) Add(t.Item1, t.Item2);
|
||||
|
||||
@@ -52,13 +52,13 @@ public sealed class ExtentsShort
|
||||
List<Tuple<short, short>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsShort() => _backend = new List<Tuple<short, short>>();
|
||||
public ExtentsShort() => _backend = [];
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsShort(IEnumerable<Tuple<short, short>> list)
|
||||
{
|
||||
_backend = new List<Tuple<short, short>>();
|
||||
_backend = [];
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<short, short> t in list) Add(t.Item1, t.Item2);
|
||||
|
||||
@@ -52,13 +52,13 @@ public sealed class ExtentsUInt
|
||||
List<Tuple<uint, uint>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsUInt() => _backend = new List<Tuple<uint, uint>>();
|
||||
public ExtentsUInt() => _backend = [];
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsUInt(IEnumerable<Tuple<uint, uint>> list)
|
||||
{
|
||||
_backend = new List<Tuple<uint, uint>>();
|
||||
_backend = [];
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<uint, uint> t in list) Add(t.Item1, t.Item2);
|
||||
|
||||
@@ -52,13 +52,13 @@ public sealed class ExtentsULong
|
||||
List<Tuple<ulong, ulong>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsULong() => _backend = new List<Tuple<ulong, ulong>>();
|
||||
public ExtentsULong() => _backend = [];
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsULong(IEnumerable<Tuple<ulong, ulong>> list)
|
||||
{
|
||||
_backend = new List<Tuple<ulong, ulong>>();
|
||||
_backend = [];
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<ulong, ulong> t in list) Add(t.Item1, t.Item2);
|
||||
|
||||
@@ -52,13 +52,13 @@ public sealed class ExtentsUShort
|
||||
List<Tuple<ushort, ushort>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsUShort() => _backend = new List<Tuple<ushort, ushort>>();
|
||||
public ExtentsUShort() => _backend = [];
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsUShort(IEnumerable<Tuple<ushort, ushort>> list)
|
||||
{
|
||||
_backend = new List<Tuple<ushort, ushort>>();
|
||||
_backend = [];
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<ushort, ushort> t in list) Add(t.Item1, t.Item2);
|
||||
|
||||
@@ -46,7 +46,7 @@ public static class Geometry
|
||||
/// <summary>List of known disk geometries</summary>
|
||||
public static readonly (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding
|
||||
encoding, bool variableSectorsPerTrack, MediaType type)[] KnownGeometries =
|
||||
{
|
||||
[
|
||||
(32, 1, 8, 319, MediaEncoding.FM, false, MediaType.IBM23FD),
|
||||
(35, 1, 9, 256, MediaEncoding.FM, false, MediaType.ECMA_66),
|
||||
(35, 1, 13, 256, MediaEncoding.AppleGCR, false, MediaType.Apple32SS),
|
||||
@@ -118,7 +118,7 @@ public static class Geometry
|
||||
(963, 8, 32, 512, MediaEncoding.MFM, false, MediaType.LS120),
|
||||
(1021, 64, 32, 512, MediaEncoding.MFM, false, MediaType.Jaz),
|
||||
(1024, 2, 32, 512, MediaEncoding.MFM, false, MediaType.FD32MB)
|
||||
};
|
||||
];
|
||||
|
||||
/// <summary>Gets the media type for a given geometry</summary>
|
||||
/// <param name="geometry">Geometry</param>
|
||||
|
||||
@@ -266,8 +266,7 @@ public class PluginRegister
|
||||
{
|
||||
if(!filter.Identify(path)) continue;
|
||||
|
||||
var foundFilter =
|
||||
(IFilter)filter.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(Array.Empty<object>());
|
||||
var foundFilter = (IFilter)filter.GetType().GetConstructor(Type.EmptyTypes)?.Invoke([]);
|
||||
|
||||
if(foundFilter?.Open(path) == ErrorNumber.NoError) return foundFilter;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user