mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Convert negated 'is' expression into 'is' expression with negated patterns.
This commit is contained in:
@@ -358,7 +358,7 @@ public class Winfsp : FileSystemBase
|
||||
|
||||
public override void Close(object fileNode, object fileDesc)
|
||||
{
|
||||
if(!(fileNode is FileNode node)) return;
|
||||
if(fileNode is not FileNode node) return;
|
||||
|
||||
if(node.Handle <= 0) return;
|
||||
|
||||
@@ -370,7 +370,7 @@ public class Winfsp : FileSystemBase
|
||||
{
|
||||
bytesTransferred = 0;
|
||||
|
||||
if(!(fileNode is FileNode node) || node.Handle <= 0) return STATUS_INVALID_HANDLE;
|
||||
if(fileNode is not FileNode node || node.Handle <= 0) return STATUS_INVALID_HANDLE;
|
||||
|
||||
var buf = new byte[length];
|
||||
|
||||
@@ -389,7 +389,7 @@ public class Winfsp : FileSystemBase
|
||||
{
|
||||
fileInfo = default(FileInfo);
|
||||
|
||||
if(!(fileNode is FileNode node)) return STATUS_INVALID_HANDLE;
|
||||
if(fileNode is not FileNode node) return STATUS_INVALID_HANDLE;
|
||||
|
||||
fileInfo = node.Info;
|
||||
|
||||
@@ -402,9 +402,9 @@ public class Winfsp : FileSystemBase
|
||||
fileName = default(string);
|
||||
fileInfo = default(FileInfo);
|
||||
|
||||
if(!(fileNode is FileNode node) || !node.IsDirectory) return false;
|
||||
if(fileNode is not FileNode node || !node.IsDirectory) return false;
|
||||
|
||||
if(!(context is IEnumerator<FileEntry> enumerator))
|
||||
if(context is not IEnumerator<FileEntry> enumerator)
|
||||
{
|
||||
if(node.MachineId > 0)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ public class App : Application
|
||||
|
||||
void OnSplashFinished(object sender, EventArgs e)
|
||||
{
|
||||
if(!(ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)) return;
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop) return;
|
||||
|
||||
// Ensure not exit
|
||||
desktop.ShutdownMode = ShutdownMode.OnExplicitShutdown;
|
||||
@@ -80,9 +80,9 @@ public class App : Application
|
||||
|
||||
void OnAboutClicked(object sender, EventArgs args)
|
||||
{
|
||||
if(!(ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) ||
|
||||
!(desktop.MainWindow is MainWindow mainWindow) ||
|
||||
!(mainWindow.DataContext is MainWindowViewModel mainWindowViewModel))
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
|
||||
desktop.MainWindow is not MainWindow mainWindow ||
|
||||
mainWindow.DataContext is not MainWindowViewModel mainWindowViewModel)
|
||||
return;
|
||||
|
||||
mainWindowViewModel.ExecuteAboutCommand();
|
||||
@@ -90,9 +90,9 @@ public class App : Application
|
||||
|
||||
void OnQuitClicked(object sender, EventArgs args)
|
||||
{
|
||||
if(!(ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) ||
|
||||
!(desktop.MainWindow is MainWindow mainWindow) ||
|
||||
!(mainWindow.DataContext is MainWindowViewModel mainWindowViewModel))
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
|
||||
desktop.MainWindow is not MainWindow mainWindow ||
|
||||
mainWindow.DataContext is not MainWindowViewModel mainWindowViewModel)
|
||||
return;
|
||||
|
||||
mainWindowViewModel.ExecuteExitCommand();
|
||||
@@ -100,9 +100,9 @@ public class App : Application
|
||||
|
||||
void OnPreferencesClicked(object sender, EventArgs args)
|
||||
{
|
||||
if(!(ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) ||
|
||||
!(desktop.MainWindow is MainWindow mainWindow) ||
|
||||
!(mainWindow.DataContext is MainWindowViewModel mainWindowViewModel))
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
|
||||
desktop.MainWindow is not MainWindow mainWindow ||
|
||||
mainWindow.DataContext is not MainWindowViewModel mainWindowViewModel)
|
||||
return;
|
||||
|
||||
mainWindowViewModel.ExecuteSettingsCommand();
|
||||
|
||||
Reference in New Issue
Block a user