mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
More pattern matching.
This commit is contained in:
@@ -184,7 +184,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
imageFormat.Info.Heads > 0 &&
|
||||
imageFormat.Info.SectorsPerTrack > 0 &&
|
||||
imageFormat.Info.XmlMediaType != XmlMediaType.OpticalDisc &&
|
||||
(imageFormat is not ITapeImage tapeImage || !tapeImage.IsTape))
|
||||
imageFormat is not ITapeImage { IsTape: true })
|
||||
MediaGeometryText =
|
||||
$"Media geometry: {imageFormat.Info.Cylinders} cylinders, {imageFormat.Info.Heads} heads, {imageFormat.Info.SectorsPerTrack} sectors per track";
|
||||
|
||||
|
||||
@@ -522,9 +522,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
try
|
||||
{
|
||||
var imageFormat = ImageFormat.Detect(inputFilter) as IMediaImage;
|
||||
|
||||
if(imageFormat == null)
|
||||
if(ImageFormat.Detect(inputFilter) is not IMediaImage imageFormat)
|
||||
{
|
||||
MessageBoxManager.GetMessageBoxStandardWindow("Error", "Image format not identified.", ButtonEnum.Ok,
|
||||
Icon.Error);
|
||||
|
||||
Reference in New Issue
Block a user