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;
|
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];
|
var buf = new byte[length];
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ public class Winfsp : FileSystemBase
|
|||||||
fileName = default(string);
|
fileName = default(string);
|
||||||
fileInfo = default(FileInfo);
|
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)
|
if(context is not IEnumerator<FileEntry> enumerator)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -80,9 +80,13 @@ public class App : Application
|
|||||||
|
|
||||||
void OnAboutClicked(object sender, EventArgs args)
|
void OnAboutClicked(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
|
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime
|
||||||
desktop.MainWindow is not MainWindow mainWindow ||
|
{
|
||||||
mainWindow.DataContext is not MainWindowViewModel mainWindowViewModel)
|
MainWindow: MainWindow
|
||||||
|
{
|
||||||
|
DataContext: MainWindowViewModel mainWindowViewModel
|
||||||
|
}
|
||||||
|
})
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mainWindowViewModel.ExecuteAboutCommand();
|
mainWindowViewModel.ExecuteAboutCommand();
|
||||||
@@ -90,9 +94,13 @@ public class App : Application
|
|||||||
|
|
||||||
void OnQuitClicked(object sender, EventArgs args)
|
void OnQuitClicked(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
|
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime
|
||||||
desktop.MainWindow is not MainWindow mainWindow ||
|
{
|
||||||
mainWindow.DataContext is not MainWindowViewModel mainWindowViewModel)
|
MainWindow: MainWindow
|
||||||
|
{
|
||||||
|
DataContext: MainWindowViewModel mainWindowViewModel
|
||||||
|
}
|
||||||
|
})
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mainWindowViewModel.ExecuteExitCommand();
|
mainWindowViewModel.ExecuteExitCommand();
|
||||||
@@ -100,9 +108,13 @@ public class App : Application
|
|||||||
|
|
||||||
void OnPreferencesClicked(object sender, EventArgs args)
|
void OnPreferencesClicked(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
|
if(ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime
|
||||||
desktop.MainWindow is not MainWindow mainWindow ||
|
{
|
||||||
mainWindow.DataContext is not MainWindowViewModel mainWindowViewModel)
|
MainWindow: MainWindow
|
||||||
|
{
|
||||||
|
DataContext: MainWindowViewModel mainWindowViewModel
|
||||||
|
}
|
||||||
|
})
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mainWindowViewModel.ExecuteSettingsCommand();
|
mainWindowViewModel.ExecuteSettingsCommand();
|
||||||
|
|||||||
Reference in New Issue
Block a user