diff --git a/src/Snap.Hutao/Snap.Hutao/Control/BoxedValues.cs b/src/Snap.Hutao/Snap.Hutao/Control/BoxedValues.cs
index f705497a..15e7d2ba 100644
--- a/src/Snap.Hutao/Snap.Hutao/Control/BoxedValues.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Control/BoxedValues.cs
@@ -9,21 +9,6 @@ namespace Snap.Hutao.Control;
[HighQuality]
internal static class BoxedValues
{
- ///
- /// 0
- ///
- public static readonly object DoubleZero = 0D;
-
- ///
- /// 1
- ///
- public static readonly object DoubleOne = 1D;
-
- ///
- /// 0
- ///
- public static readonly object Int32Zero = 0;
-
///
///
///
diff --git a/src/Snap.Hutao/Snap.Hutao/Core/RuntimeOptions.cs b/src/Snap.Hutao/Snap.Hutao/Core/RuntimeOptions.cs
index 30aa3f95..3ae76131 100644
--- a/src/Snap.Hutao/Snap.Hutao/Core/RuntimeOptions.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Core/RuntimeOptions.cs
@@ -131,8 +131,6 @@ internal sealed class RuntimeOptions : IOptions
private static bool GetElevated()
{
- return true;
-
using (WindowsIdentity identity = WindowsIdentity.GetCurrent())
{
WindowsPrincipal principal = new(identity);
diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Threading/Throttler.cs b/src/Snap.Hutao/Snap.Hutao/Core/Threading/Throttler.cs
new file mode 100644
index 00000000..1b12e79e
--- /dev/null
+++ b/src/Snap.Hutao/Snap.Hutao/Core/Threading/Throttler.cs
@@ -0,0 +1,19 @@
+// Copyright (c) DGP Studio. All rights reserved.
+// Licensed under the MIT license.
+
+using System.Collections.Concurrent;
+using System.Runtime.CompilerServices;
+
+namespace Snap.Hutao.Core.Threading;
+
+internal sealed class Throttler
+{
+ private readonly ConcurrentDictionary methodSemaphoreMap = new();
+
+ public ValueTask ThrottleAsync(CancellationToken token = default, [CallerMemberName] string callerName = default!, [CallerLineNumber] int callerLine = 0)
+ {
+ string key = $"{callerName}L{callerLine}";
+ SemaphoreSlim semaphore = methodSemaphoreMap.GetOrAdd(key, name => new SemaphoreSlim(1));
+ return semaphore.EnterAsync(token);
+ }
+}
\ No newline at end of file
diff --git a/src/Snap.Hutao/Snap.Hutao/MainWindow.xaml.cs b/src/Snap.Hutao/Snap.Hutao/MainWindow.xaml.cs
index 35186dab..a2be57a4 100644
--- a/src/Snap.Hutao/Snap.Hutao/MainWindow.xaml.cs
+++ b/src/Snap.Hutao/Snap.Hutao/MainWindow.xaml.cs
@@ -6,6 +6,7 @@ using Microsoft.UI.Xaml;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Core.Windowing;
using Snap.Hutao.Message;
+using Windows.Foundation;
using Windows.Win32.UI.WindowsAndMessaging;
namespace Snap.Hutao;
@@ -22,6 +23,8 @@ internal sealed partial class MainWindow : Window, IWindowOptionsSource, IRecipi
private const int MinHeight = 524;
private readonly WindowOptions windowOptions;
+ private readonly ILogger logger;
+ private readonly TypedEventHandler