Skip to content

Commit a6c7430

Browse files
committed
Code quality
1 parent 218635a commit a6c7430

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ public static class Win32Helper
2121
{
2222
#region Blur Handling
2323

24-
public static bool IsWindows11()
25-
{
26-
return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 22000;
27-
}
2824
public static bool IsBackdropSupported()
2925
{
3026
// Mica and Acrylic only supported Windows 11 22000+
@@ -525,6 +521,12 @@ public static bool IsNotificationSupported()
525521

526522
#region Korean IME
527523

524+
public static bool IsWindows11()
525+
{
526+
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
527+
Environment.OSVersion.Version.Build >= 22000;
528+
}
529+
528530
public static bool IsKoreanIMEExist()
529531
{
530532
return GetLegacyKoreanIMERegistryValue() != null;

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ public bool KoreanIMERegistryKeyExists
210210
{
211211
get
212212
{
213-
bool registryKeyExists = Win32Helper.IsKoreanIMEExist();
214-
bool koreanLanguageInstalled = InputLanguage.InstalledInputLanguages.Cast<InputLanguage>().Any(lang => lang.Culture.Name.StartsWith("ko"));
215-
bool isWindows11 = Win32Helper.IsWindows11();
213+
var registryKeyExists = Win32Helper.IsKoreanIMEExist();
214+
var koreanLanguageInstalled = InputLanguage.InstalledInputLanguages.Cast<InputLanguage>().Any(lang => lang.Culture.Name.StartsWith("ko"));
215+
var isWindows11 = Win32Helper.IsWindows11();
216216

217217
// Return true if Windows 11 with Korean IME installed, or if the registry key exists
218218
return (isWindows11 && koreanLanguageInstalled) || registryKeyExists;
@@ -223,12 +223,12 @@ public bool KoreanIMERegistryValueIsZero
223223
{
224224
get
225225
{
226-
object value = Win32Helper.GetLegacyKoreanIMERegistryValue();
226+
var value = Win32Helper.GetLegacyKoreanIMERegistryValue();
227227
if (value is int intValue)
228228
{
229229
return intValue == 0;
230230
}
231-
else if (value != null && int.TryParse(value.ToString(), out int parsedValue))
231+
else if (value != null && int.TryParse(value.ToString(), out var parsedValue))
232232
{
233233
return parsedValue == 0;
234234
}

0 commit comments

Comments
 (0)