From e0d0f054b9f5d8d5945b4deca383f4b969410c3a Mon Sep 17 00:00:00 2001 From: wherewhere Date: Sun, 13 Oct 2024 15:31:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- CoreAppUWP/App.xaml.cs | 2 +- CoreAppUWP/Common/ThreadSwitcher.cs | 4 ++-- CoreAppUWP/Common/WeakEvent.cs | 13 +++++-------- CoreAppUWP/CoreAppUWP.csproj | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index b196e48..631e59a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -31,7 +31,7 @@ body: required: true attributes: label: App version - description: Specify the version of Coolapk Lite you're using. + description: Specify the version of CoreAppUWP you're using. options: - "0.0.1" - type: dropdown diff --git a/CoreAppUWP/App.xaml.cs b/CoreAppUWP/App.xaml.cs index d4b4337..dd862dc 100644 --- a/CoreAppUWP/App.xaml.cs +++ b/CoreAppUWP/App.xaml.cs @@ -28,7 +28,7 @@ public App() InitializeComponent(); UnhandledException += Application_UnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; - FocusVisualKind = AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Xbox" ? FocusVisualKind.Reveal : FocusVisualKind.HighVisibility; + if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Xbox") { FocusVisualKind = FocusVisualKind.Reveal; } } /// diff --git a/CoreAppUWP/Common/ThreadSwitcher.cs b/CoreAppUWP/Common/ThreadSwitcher.cs index db9520e..83b13b2 100644 --- a/CoreAppUWP/Common/ThreadSwitcher.cs +++ b/CoreAppUWP/Common/ThreadSwitcher.cs @@ -65,7 +65,7 @@ public void GetResult() { } IThreadSwitcher IThreadSwitcher.GetAwaiter() => this; /// - public void OnCompleted(Action continuation) => _ = Dispatcher.RunAsync(Priority, () => continuation()); + public void OnCompleted(Action continuation) => _ = Dispatcher.RunAsync(Priority, continuation.Invoke); } /// @@ -89,7 +89,7 @@ public void GetResult() { } IThreadSwitcher IThreadSwitcher.GetAwaiter() => this; /// - public void OnCompleted(Action continuation) => _ = Dispatcher.TryEnqueue(Priority, () => continuation()); + public void OnCompleted(Action continuation) => _ = Dispatcher.TryEnqueue(Priority, continuation.Invoke); } /// diff --git a/CoreAppUWP/Common/WeakEvent.cs b/CoreAppUWP/Common/WeakEvent.cs index a912f89..6a96928 100644 --- a/CoreAppUWP/Common/WeakEvent.cs +++ b/CoreAppUWP/Common/WeakEvent.cs @@ -34,15 +34,12 @@ public bool Equals(Action callback) => && _reference.Target == callback.Target && _method == callback.GetMethodInfo(); - public override bool Equals(object obj) + public override bool Equals(object obj) => obj switch { - return obj switch - { - Method other => Equals(other), - Action callback => Equals(callback), - _ => false, - }; - } + Method other => Equals(other), + Action callback => Equals(callback), + _ => false, + }; public override int GetHashCode() => (_reference, _method).GetHashCode(); diff --git a/CoreAppUWP/CoreAppUWP.csproj b/CoreAppUWP/CoreAppUWP.csproj index 64988b3..91dc233 100644 --- a/CoreAppUWP/CoreAppUWP.csproj +++ b/CoreAppUWP/CoreAppUWP.csproj @@ -17,7 +17,7 @@ partial True 0.0.1 - 10.0.22621.42 + 10.0.22621.48