code_style: general cleanup (#1428)

This commit is contained in:
Nathan Baulch 2025-06-18 11:29:18 +10:00 committed by GitHub
parent ae46728bbc
commit d404f6dbe2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 123 additions and 240 deletions

View file

@ -54,7 +54,7 @@ namespace SourceGit.Native
public void SetupApp(AppBuilder builder)
{
// Fix drop shadow issue on Windows 10
if (!OperatingSystem.IsWindowsVersionAtLeast(10, 22000, 0))
if (!OperatingSystem.IsWindowsVersionAtLeast(10, 22000))
{
Window.WindowStateProperty.Changed.AddClassHandler<Window>((w, _) => FixWindowFrameOnWin10(w));
Control.LoadedEvent.AddClassHandler<Window>((w, _) => FixWindowFrameOnWin10(w));
@ -385,11 +385,11 @@ namespace SourceGit.Native
Microsoft.Win32.RegistryView.Registry64);
// Get default class for VisualStudio.Launcher.sln - the handler for *.sln files
if (localMachine.OpenSubKey(@"SOFTWARE\Classes\VisualStudio.Launcher.sln\CLSID") is Microsoft.Win32.RegistryKey launcher)
if (localMachine.OpenSubKey(@"SOFTWARE\Classes\VisualStudio.Launcher.sln\CLSID") is { } launcher)
{
// Get actual path to the executable
if (launcher.GetValue(string.Empty) is string CLSID &&
localMachine.OpenSubKey(@$"SOFTWARE\Classes\CLSID\{CLSID}\LocalServer32") is Microsoft.Win32.RegistryKey devenv &&
localMachine.OpenSubKey(@$"SOFTWARE\Classes\CLSID\{CLSID}\LocalServer32") is { } devenv &&
devenv.GetValue(string.Empty) is string localServer32)
return localServer32!.Trim('\"');
}