mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
exception refine
This commit is contained in:
@@ -33,7 +33,7 @@ internal sealed class HotKeyMessageWindow : IDisposable
|
||||
atom = RegisterClassW(&wc);
|
||||
}
|
||||
|
||||
ArgumentOutOfRangeException.ThrowIfEqual<ushort>(atom, 0);
|
||||
ArgumentOutOfRangeException.ThrowIfZero(atom);
|
||||
|
||||
HWND = CreateWindowExW(0, WindowClassName, WindowClassName, 0, 0, 0, 0, 0, default, default, default, default);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ internal sealed class NotifyIconMessageWindow : IDisposable
|
||||
atom = RegisterClassW(&wc);
|
||||
}
|
||||
|
||||
ArgumentOutOfRangeException.ThrowIfEqual<ushort>(atom, 0);
|
||||
ArgumentOutOfRangeException.ThrowIfZero(atom);
|
||||
|
||||
// https://learn.microsoft.com/zh,cn/windows/win32/shell/taskbar#taskbar,creation,notification
|
||||
WM_TASKBARCREATED = RegisterWindowMessageW("TaskbarCreated");
|
||||
|
||||
@@ -25,7 +25,7 @@ internal sealed class GameScreenCaptureMemoryPool : MemoryPool<byte>
|
||||
|
||||
public override IMemoryOwner<byte> Rent(int minBufferSize = -1)
|
||||
{
|
||||
ArgumentOutOfRangeException.ThrowIfLessThan(minBufferSize, 0);
|
||||
ArgumentOutOfRangeException.ThrowIfNegative(minBufferSize);
|
||||
|
||||
lock (syncRoot)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ internal static class CookieExtension
|
||||
|
||||
private static bool TryGetValuesToCookie(this Cookie source, in ReadOnlySpan<string> keys, [NotNullWhen(true)] out Cookie? cookie)
|
||||
{
|
||||
ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(keys.Length, 0, "Empty keys is not supported");
|
||||
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(keys.Length);
|
||||
SortedDictionary<string, string> cookieMap = [];
|
||||
|
||||
foreach (ref readonly string key in keys)
|
||||
|
||||
Reference in New Issue
Block a user