Code quality

This commit is contained in:
Jack251970 2025-04-03 22:13:12 +08:00
parent 5d16216a55
commit 96f10d2799
2 changed files with 13 additions and 3 deletions

View file

@ -488,5 +488,16 @@ namespace Flow.Launcher.Infrastructure
}
#endregion
#region Noticification
public static bool IsNotificationSupport()
{
// Noticification only supported Windows 10 19041+
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
Environment.OSVersion.Version.Build >= 19041;
}
#endregion
}
}

View file

@ -9,8 +9,8 @@ namespace Flow.Launcher
{
internal static class Notification
{
internal static bool legacy = Environment.OSVersion.Version.Build < 19041;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")]
internal static bool legacy = !Win32Helper.IsNotificationSupport();
internal static void Uninstall()
{
if (!legacy)
@ -25,7 +25,6 @@ namespace Flow.Launcher
});
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")]
private static void ShowInternal(string title, string subTitle, string iconPath = null)
{
// Handle notification for win7/8/early win10