From f5253105fdfdff08e4979149fe596c3f5f0374b5 Mon Sep 17 00:00:00 2001 From: zzyyyl Date: Thu, 10 Nov 2022 15:23:58 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAsstGui/Helper/ToastNotification.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MeoAsstGui/Helper/ToastNotification.cs b/src/MeoAsstGui/Helper/ToastNotification.cs index ac19b6feb1..c248d73202 100644 --- a/src/MeoAsstGui/Helper/ToastNotification.cs +++ b/src/MeoAsstGui/Helper/ToastNotification.cs @@ -24,13 +24,13 @@ using System.Windows; using System.Windows.Interop; using System.Windows.Media; using System.Windows.Media.Imaging; -using Stylet; using Microsoft.Toolkit.Uwp.Notifications; using Microsoft.Win32; using Notification.Wpf; using Notification.Wpf.Base; using Notification.Wpf.Constants; using Notification.Wpf.Controls; +using Stylet; namespace MeoAsstGui { @@ -71,8 +71,7 @@ namespace MeoAsstGui } var osVersion = matched.Groups[0].Value; - Semver.SemVersion curVersionObj; - bool verParsed = Semver.SemVersion.TryParse(osVersion, Semver.SemVersionStyles.Strict, out curVersionObj); + bool verParsed = Semver.SemVersion.TryParse(osVersion, Semver.SemVersionStyles.Strict, out var curVersionObj); var minimumVersionObj = new Semver.SemVersion(10, 0, 10240); _systemToastChecked = verParsed && curVersionObj.CompareSortOrderTo(minimumVersionObj) >= 0; @@ -421,6 +420,7 @@ namespace MeoAsstGui .Show(); } }); + // 通知正常弹出了就直接 return,否则用 catch 下面的兼容版通知 return; } @@ -466,7 +466,7 @@ namespace MeoAsstGui NotificationSounds sound = NotificationSounds.None, NotificationContent notificationContent = null) { - notificationContent = notificationContent ?? BaseContent(); + notificationContent ??= BaseContent(); notificationContent.TrimType = NotificationTextTrimType.Attach; Show(lifeTime: lifeTime,