mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Merge negated null/pattern checks into complex pattern.
This commit is contained in:
@@ -370,7 +370,7 @@ public class Winfsp : FileSystemBase
|
||||
{
|
||||
bytesTransferred = 0;
|
||||
|
||||
if(fileNode is not FileNode node || node.Handle <= 0) return STATUS_INVALID_HANDLE;
|
||||
if(fileNode is not FileNode { Handle: > 0 } node) return STATUS_INVALID_HANDLE;
|
||||
|
||||
var buf = new byte[length];
|
||||
|
||||
@@ -402,7 +402,7 @@ public class Winfsp : FileSystemBase
|
||||
fileName = default(string);
|
||||
fileInfo = default(FileInfo);
|
||||
|
||||
if(fileNode is not FileNode node || !node.IsDirectory) return false;
|
||||
if(fileNode is not FileNode { IsDirectory: true } node) return false;
|
||||
|
||||
if(context is not IEnumerator<FileEntry> enumerator)
|
||||
{
|
||||
|
||||
@@ -80,9 +80,13 @@ public class App : Application
|
||||
|
||||
void OnAboutClicked(object sender, EventArgs args)
|
||||
{
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
|
||||
desktop.MainWindow is not MainWindow mainWindow ||
|
||||
mainWindow.DataContext is not MainWindowViewModel mainWindowViewModel)
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime
|
||||
{
|
||||
MainWindow: MainWindow
|
||||
{
|
||||
DataContext: MainWindowViewModel mainWindowViewModel
|
||||
}
|
||||
})
|
||||
return;
|
||||
|
||||
mainWindowViewModel.ExecuteAboutCommand();
|
||||
@@ -90,9 +94,13 @@ public class App : Application
|
||||
|
||||
void OnQuitClicked(object sender, EventArgs args)
|
||||
{
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
|
||||
desktop.MainWindow is not MainWindow mainWindow ||
|
||||
mainWindow.DataContext is not MainWindowViewModel mainWindowViewModel)
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime
|
||||
{
|
||||
MainWindow: MainWindow
|
||||
{
|
||||
DataContext: MainWindowViewModel mainWindowViewModel
|
||||
}
|
||||
})
|
||||
return;
|
||||
|
||||
mainWindowViewModel.ExecuteExitCommand();
|
||||
@@ -100,9 +108,13 @@ public class App : Application
|
||||
|
||||
void OnPreferencesClicked(object sender, EventArgs args)
|
||||
{
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
|
||||
desktop.MainWindow is not MainWindow mainWindow ||
|
||||
mainWindow.DataContext is not MainWindowViewModel mainWindowViewModel)
|
||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime
|
||||
{
|
||||
MainWindow: MainWindow
|
||||
{
|
||||
DataContext: MainWindowViewModel mainWindowViewModel
|
||||
}
|
||||
})
|
||||
return;
|
||||
|
||||
mainWindowViewModel.ExecuteSettingsCommand();
|
||||
|
||||
Reference in New Issue
Block a user