diff --git a/.editorconfig b/.editorconfig
index 18e1e52d..ee3469c6 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -226,6 +226,5 @@ dotnet_naming_style.camel_begin_with__.required_prefix = _
dotnet_naming_style.camel_begin_with__.capitalization = camel_case
-
# ReSharper properties
resharper_max_initializer_elements_on_line = 1
diff --git a/.gitattributes b/.gitattributes
index 7c23de33..d14a7e03 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -38,7 +38,6 @@
*.filters text eol=crlf
*.vcxitems text eol=crlf
-
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
diff --git a/README.en.md b/README.en.md
index 3096a008..3a0f585a 100644
--- a/README.en.md
+++ b/README.en.md
@@ -30,17 +30,18 @@
---
**The Pixeval that based on WinUI 3 is now WIP, the older version,
-which is the WPF version has been deprecated and expecting no more supports from developers,
-the WinUI 3 version provides a better user interface,
-a more structural codebase and a modern development experience compared to the WPF version.
-You can download and compile it yourself if you want to take a glance at the new version,
-follow the following steps to compile and run:**
-
-For more information, see [main page](https://sora.ink/pixeval/)
+which is the WPF version has been deprecated and expecting no more supports from developers.**
> The WinUI 3 codebase for Pixeval supports only Windows 10 (1809, Build Number 17763) and higher.
> You can check this at Settings | System | About | Windows specifications
+For more information, see [main page](https://sora.ink/pixeval/)
+
+**The WinUI 3 version provides a better user interface,
+a more structural codebase and a modern development experience compared to the WPF version.
+You can download and compile it yourself if you want to take a glance at the new version,
+follow the following steps to compile and run:**
+
## Prerequisites
1. Install [Visual Studio 2022](https://visualstudio.microsoft.com/vs) (Roslyn 4.x requires VS17.x, i.e. VS2022)
@@ -108,10 +109,9 @@ If this project meets your requirements perfectly, welcome the buy me a coffee a
## JetBrains Open Source License
-
The Jetbrains™ ReSharper is heavily used during the development of this project. Thank JetBrains s.r.o for providing the [JetBrains Open Source License]((https://www.jetbrains.com/community/opensource/#support)), If you are one of the passionate developers who often put JetBrains products into use, you can try to apply the JetBrains Open Source License from the [official channel](https://www.jetbrains.com/shop/eform/opensource) to help you and your developer teammates to significantly improve the productivities
-
\ No newline at end of file
+
diff --git a/README.md b/README.md
index f5d78d2c..be78c632 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@
更多详细信息请前往 [项目主页](https://sora.ink/pixeval) 查看
-**WinUI3版本提供了更好的UI,更好的项目结构以及更好的开发体验,如果你想要了解目前的开发进度,可以通过以下方法来下载并编译该项目**
+**WinUI3版本提供了更好的UI,更好的项目结构以及更好的开发体验,如果你想要了解目前的开发进度,可以通过以下方法来下载并编译该项目:**
## 环境要求
@@ -108,4 +108,4 @@
本项目重度依赖于 [JetBrains](https://www.jetbrains.com/?from=ImageSharp) ReSharper,感谢JetBrains s.r.o为本项目提供 [开源许可证](https://www.jetbrains.com/community/opensource/#support),如果你同样对开发充满热情并且经常使用JetBrains s.r.o的产品,你也可以尝试通过JetBrains官方渠道 [申请](https://www.jetbrains.com/shop/eform/opensource) 开源许可证以供核心开发者使用
-
\ No newline at end of file
+
diff --git a/src/Pixeval.Controls/CardControl/CardControlAutomationPeer.cs b/src/Pixeval.Controls/CardControl/CardControlAutomationPeer.cs
index 4b052b8e..20e57a0f 100644
--- a/src/Pixeval.Controls/CardControl/CardControlAutomationPeer.cs
+++ b/src/Pixeval.Controls/CardControl/CardControlAutomationPeer.cs
@@ -25,17 +25,12 @@ namespace Pixeval.Controls;
///
/// AutomationPeer for CardControl
///
-public class CardControlAutomationPeer : FrameworkElementAutomationPeer
+///
+/// Initializes a new instance of the class.
+///
+/// CardControl
+public class CardControlAutomationPeer(CardControl owner) : FrameworkElementAutomationPeer(owner)
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// CardControl
- public CardControlAutomationPeer(CardControl owner)
- : base(owner)
- {
- }
-
///
/// Gets the control type for the element that is associated with the UI Automation peer.
///
diff --git a/src/Pixeval.Controls/PersonView/PersonView.xaml.cs b/src/Pixeval.Controls/PersonView/PersonView.xaml.cs
index 9aef90fd..4061d54b 100644
--- a/src/Pixeval.Controls/PersonView/PersonView.xaml.cs
+++ b/src/Pixeval.Controls/PersonView/PersonView.xaml.cs
@@ -43,6 +43,6 @@ public partial class PersonView : UserControl
private async void ContentContainerOnTapped(object sender, TappedRoutedEventArgs e)
{
- await Launcher.LaunchUriAsync(PersonProfileNavigateUri);
+ _ = await Launcher.LaunchUriAsync(PersonProfileNavigateUri);
}
}
diff --git a/src/Pixeval.Controls/Pixeval.Controls.csproj b/src/Pixeval.Controls/Pixeval.Controls.csproj
index 54dfd3fa..61228ac0 100644
--- a/src/Pixeval.Controls/Pixeval.Controls.csproj
+++ b/src/Pixeval.Controls/Pixeval.Controls.csproj
@@ -1,7 +1,7 @@
- net8.0-windows10.0.19041.0
- 10.0.17763.0
+ net8.0-windows10.0.22621.0
+ 10.0.19041.0Pixeval.Controlsx86;x64;arm64win-x86;win-x64;win-arm64
diff --git a/src/Pixeval.Controls/PixevalBadge/PixevalBadge.xaml.cs b/src/Pixeval.Controls/PixevalBadge/PixevalBadge.xaml.cs
index b9cf8794..3203bfde 100644
--- a/src/Pixeval.Controls/PixevalBadge/PixevalBadge.xaml.cs
+++ b/src/Pixeval.Controls/PixevalBadge/PixevalBadge.xaml.cs
@@ -48,6 +48,6 @@ public sealed partial class PixevalBadge : UserControl
private void GoToState(bool useSmall)
{
- VisualStateManager.GoToState(this, useSmall ? SmallState : NormalState, true);
+ _ = VisualStateManager.GoToState(this, useSmall ? SmallState : NormalState, true);
}
}
diff --git a/src/Pixeval.Controls/Windowing/ISupportCustomTitleBarDragRegion.cs b/src/Pixeval.Controls/Windowing/ISupportCustomTitleBarDragRegion.cs
index e1254f85..24f41112 100644
--- a/src/Pixeval.Controls/Windowing/ISupportCustomTitleBarDragRegion.cs
+++ b/src/Pixeval.Controls/Windowing/ISupportCustomTitleBarDragRegion.cs
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-
namespace Pixeval.Controls.Windowing;
public interface ISupportCustomTitleBarDragRegion
diff --git a/src/Pixeval.Controls/Windowing/WindowFactory.cs b/src/Pixeval.Controls/Windowing/WindowFactory.cs
index 7ccfdaea..0c4870a9 100644
--- a/src/Pixeval.Controls/Windowing/WindowFactory.cs
+++ b/src/Pixeval.Controls/Windowing/WindowFactory.cs
@@ -34,7 +34,7 @@ public static class WindowFactory
public static EnhancedWindow RootWindow => _forkedWindowsInternal[0];
- private static readonly List _forkedWindowsInternal = new();
+ private static readonly List _forkedWindowsInternal = [];
public static IReadOnlyList ForkedWindows => _forkedWindowsInternal;
diff --git a/src/Pixeval.Controls/ZoomableImage/ZoomableImage.xaml.cs b/src/Pixeval.Controls/ZoomableImage/ZoomableImage.xaml.cs
index 2f17d076..4aee20c0 100644
--- a/src/Pixeval.Controls/ZoomableImage/ZoomableImage.xaml.cs
+++ b/src/Pixeval.Controls/ZoomableImage/ZoomableImage.xaml.cs
@@ -134,7 +134,7 @@ public sealed partial class ZoomableImage : UserControl
private bool _timerRunning;
private CanvasBitmap? _currentFrame;
- private readonly List _frames = new();
+ private readonly List _frames = [];
private readonly CancellationTokenSource _token = new();
private List? ClonedMsIntervals { get; set; }
private ManualResetEvent ManualResetEvent { get; } = new(true);
diff --git a/src/Pixeval.CoreApi/Engine/ICancellable.cs b/src/Pixeval.CoreApi/Engine/ICancellable.cs
index c16233ee..99b89fe4 100644
--- a/src/Pixeval.CoreApi/Engine/ICancellable.cs
+++ b/src/Pixeval.CoreApi/Engine/ICancellable.cs
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-
namespace Pixeval.CoreApi.Engine;
public interface ICancellable
diff --git a/src/Pixeval.CoreApi/Engine/ICompletionCallback.cs b/src/Pixeval.CoreApi/Engine/ICompletionCallback.cs
index e8b92d0e..a0dfeaa7 100644
--- a/src/Pixeval.CoreApi/Engine/ICompletionCallback.cs
+++ b/src/Pixeval.CoreApi/Engine/ICompletionCallback.cs
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-
namespace Pixeval.CoreApi.Engine;
public interface ICompletionCallback
diff --git a/src/Pixeval.CoreApi/Engine/IEngineHandle.cs b/src/Pixeval.CoreApi/Engine/IEngineHandle.cs
index 10810742..60714b91 100644
--- a/src/Pixeval.CoreApi/Engine/IEngineHandle.cs
+++ b/src/Pixeval.CoreApi/Engine/IEngineHandle.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-
namespace Pixeval.CoreApi.Engine;
///
@@ -29,4 +28,4 @@ namespace Pixeval.CoreApi.Engine;
public interface IEngineHandleSource
{
EngineHandle EngineHandle { get; }
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/Engine/INotifyCompletion.cs b/src/Pixeval.CoreApi/Engine/INotifyCompletion.cs
index 20841c77..dde2fd84 100644
--- a/src/Pixeval.CoreApi/Engine/INotifyCompletion.cs
+++ b/src/Pixeval.CoreApi/Engine/INotifyCompletion.cs
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-
namespace Pixeval.CoreApi.Engine;
public interface INotifyCompletion
diff --git a/src/Pixeval.CoreApi/Engine/Implements/AdaptedComputedFetchEngine.cs b/src/Pixeval.CoreApi/Engine/Implements/AdaptedComputedFetchEngine.cs
index f485f712..711e7dbc 100644
--- a/src/Pixeval.CoreApi/Engine/Implements/AdaptedComputedFetchEngine.cs
+++ b/src/Pixeval.CoreApi/Engine/Implements/AdaptedComputedFetchEngine.cs
@@ -31,20 +31,15 @@ namespace Pixeval.CoreApi.Engine.Implements;
/// only supposed to be used by caching systems
///
/// The type of the results of the
-public class AdaptedComputedFetchEngine : IFetchEngine
+///
+/// Creates an that delegates all of its
+/// property and methods to
+///
+///
+/// The that is going to be delegated
+public class AdaptedComputedFetchEngine(IEnumerable outer) : IFetchEngine
{
- private readonly IEnumerable _outer;
-
- ///
- /// Creates an that delegates all of its
- /// property and methods to
- ///
- ///
- /// The that is going to be delegated
- public AdaptedComputedFetchEngine(IEnumerable outer)
- {
- _outer = outer;
- }
+ private readonly IEnumerable _outer = outer;
public MakoClient MakoClient => throw new NotSupportedException();
diff --git a/src/Pixeval.CoreApi/Engine/Implements/BookmarkEngine.cs b/src/Pixeval.CoreApi/Engine/Implements/BookmarkEngine.cs
index b1eb47cc..01f2e1d3 100644
--- a/src/Pixeval.CoreApi/Engine/Implements/BookmarkEngine.cs
+++ b/src/Pixeval.CoreApi/Engine/Implements/BookmarkEngine.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -30,31 +30,24 @@ namespace Pixeval.CoreApi.Engine.Implements;
///
/// An that fetches the bookmark of a specific user
///
-internal class BookmarkEngine : AbstractPixivFetchEngine
+///
+/// Creates a
+///
+/// The that owns this object
+/// Id of the user
+/// The privacy option
+/// Indicates the target API of the fetch operation
+///
+internal class BookmarkEngine(
+ MakoClient makoClient,
+ string uid,
+ PrivacyPolicy privacyPolicy,
+ TargetFilter targetFilter,
+ EngineHandle? engineHandle = null) : AbstractPixivFetchEngine(makoClient, engineHandle)
{
- private readonly PrivacyPolicy _privacyPolicy;
- private readonly TargetFilter _targetFilter;
- private readonly string _uid;
-
- ///
- /// Creates a
- ///
- /// The that owns this object
- /// Id of the user
- /// The privacy option
- /// Indicates the target API of the fetch operation
- ///
- public BookmarkEngine(
- MakoClient makoClient,
- string uid,
- PrivacyPolicy privacyPolicy,
- TargetFilter targetFilter,
- EngineHandle? engineHandle = null) : base(makoClient, engineHandle)
- {
- _uid = uid;
- _privacyPolicy = privacyPolicy;
- _targetFilter = targetFilter;
- }
+ private readonly PrivacyPolicy _privacyPolicy = privacyPolicy;
+ private readonly TargetFilter _targetFilter = targetFilter;
+ private readonly string _uid = uid;
public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = new())
{
@@ -64,4 +57,4 @@ internal class BookmarkEngine : AbstractPixivFetchEngine
+ $"&restrict={engine._privacyPolicy.GetDescription()}"
+ $"&filter={engine._targetFilter.GetDescription()}")!;
}
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/Engine/Implements/FeedEngine.cs b/src/Pixeval.CoreApi/Engine/Implements/FeedEngine.cs
index cd604c40..69306e68 100644
--- a/src/Pixeval.CoreApi/Engine/Implements/FeedEngine.cs
+++ b/src/Pixeval.CoreApi/Engine/Implements/FeedEngine.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -33,20 +33,19 @@ using Pixeval.Utilities;
namespace Pixeval.CoreApi.Engine.Implements;
-internal class FeedEngine(MakoClient makoClient, EngineHandle? engineHandle) : AbstractPixivFetchEngine(makoClient, engineHandle)
+internal partial class FeedEngine(MakoClient makoClient, EngineHandle? engineHandle) : AbstractPixivFetchEngine(makoClient, engineHandle)
{
public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = new())
{
return new UserFeedsAsyncEnumerator(this, MakoApiKind.WebApi)!;
}
- private class UserFeedsAsyncEnumerator
+ private partial class UserFeedsAsyncEnumerator
(FeedEngine pixivFetchEngine, MakoApiKind apiKind) : AbstractPixivAsyncEnumerator(pixivFetchEngine, apiKind)
{
private FeedRequestContext? _feedRequestContext;
private string? _tt;
-
public override async ValueTask MoveNextAsync()
{
if (_feedRequestContext is null)
@@ -57,7 +56,7 @@ internal class FeedEngine(MakoClient makoClient, EngineHandle? engineHandle) : A
if (TryParsePreloadJsonFromHtml(response, out var result))
{
await UpdateAsync(result).ConfigureAwait(false);
- _tt = Regex.Match(response, "tt: \"(?.*)\"").Groups["tt"].Value;
+ _tt = TtRegex().Match(response).Groups["tt"].Value;
_feedRequestContext = ExtractRequestContextFromHtml(response);
}
else
@@ -147,7 +146,7 @@ internal class FeedEngine(MakoClient makoClient, EngineHandle? engineHandle) : A
private static bool TryExtractPreloadJson(string html, out string json)
{
- var match = Regex.Match(html, "pixiv\\.stacc\\.env\\.preload\\.stacc \\= (?.*);");
+ var match = PreloadRegex().Match(html);
if (match.Success)
{
json = match.Groups["json"].Value;
@@ -296,10 +295,15 @@ internal class FeedEngine(MakoClient makoClient, EngineHandle? engineHandle) : A
return Result.OfFailure(new MakoNetworkException(url, MakoClient.Configuration.Bypass, e.Message, (int?)e.StatusCode ?? -1));
}
}
+
+ [GeneratedRegex("tt: \"(?.*)\"")]
+ private static partial Regex TtRegex();
+ [GeneratedRegex("pixiv\\.stacc\\.env\\.preload\\.stacc \\= (?.*);")]
+ private static partial Regex PreloadRegex();
}
///
/// Required parameters established from multiple tests, I don't know what do they mean
///
private record FeedRequestContext(string UnifyToken, string Sid, string Mode, bool IsLastPage);
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/Global/Exception/IllegalPrivatePolicyException.cs b/src/Pixeval.CoreApi/Global/Exception/IllegalPrivatePolicyException.cs
index 7f409595..a3b96a90 100644
--- a/src/Pixeval.CoreApi/Global/Exception/IllegalPrivatePolicyException.cs
+++ b/src/Pixeval.CoreApi/Global/Exception/IllegalPrivatePolicyException.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-using System.Runtime.Serialization;
using Pixeval.CoreApi.Global.Enum;
namespace Pixeval.CoreApi.Global.Exception;
@@ -34,11 +33,6 @@ public class IllegalPrivatePolicyException : MakoException
Uid = uid;
}
- protected IllegalPrivatePolicyException(SerializationInfo info, StreamingContext context, string uid) : base(info, context)
- {
- Uid = uid;
- }
-
public IllegalPrivatePolicyException(string? message, string uid) : base(message)
{
Uid = uid;
@@ -50,4 +44,4 @@ public class IllegalPrivatePolicyException : MakoException
}
public string Uid { get; }
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/Global/Exception/IllegalSortOptionException.cs b/src/Pixeval.CoreApi/Global/Exception/IllegalSortOptionException.cs
index 76409d4b..4b6eebc9 100644
--- a/src/Pixeval.CoreApi/Global/Exception/IllegalSortOptionException.cs
+++ b/src/Pixeval.CoreApi/Global/Exception/IllegalSortOptionException.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -18,8 +18,6 @@
// along with this program. If not, see .
#endregion
-using System.Runtime.Serialization;
-
namespace Pixeval.CoreApi.Global.Exception;
///
@@ -31,10 +29,6 @@ public class IllegalSortOptionException : MakoException
{
}
- protected IllegalSortOptionException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
-
public IllegalSortOptionException(string? message) : base(message)
{
}
@@ -42,4 +36,4 @@ public class IllegalSortOptionException : MakoException
public IllegalSortOptionException(string? message, System.Exception? innerException) : base(message, innerException)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/Global/Exception/MakoException.cs b/src/Pixeval.CoreApi/Global/Exception/MakoException.cs
index 6aa6098a..020dbe9c 100644
--- a/src/Pixeval.CoreApi/Global/Exception/MakoException.cs
+++ b/src/Pixeval.CoreApi/Global/Exception/MakoException.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -18,8 +18,6 @@
// along with this program. If not, see .
#endregion
-using System.Runtime.Serialization;
-
namespace Pixeval.CoreApi.Global.Exception;
public class MakoException : System.Exception
@@ -28,10 +26,6 @@ public class MakoException : System.Exception
{
}
- protected MakoException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
-
public MakoException(string? message) : base(message)
{
}
@@ -39,4 +33,4 @@ public class MakoException : System.Exception
public MakoException(string? message, System.Exception? innerException) : base(message, innerException)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/Global/Exception/MangaPagesNotFoundException.cs b/src/Pixeval.CoreApi/Global/Exception/MangaPagesNotFoundException.cs
index dde21a40..e75b1f52 100644
--- a/src/Pixeval.CoreApi/Global/Exception/MangaPagesNotFoundException.cs
+++ b/src/Pixeval.CoreApi/Global/Exception/MangaPagesNotFoundException.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-using System.Runtime.Serialization;
using Pixeval.CoreApi.Model;
namespace Pixeval.CoreApi.Global.Exception;
@@ -30,11 +29,6 @@ public class MangaPagesNotFoundException : MakoException
Illustration = illustration;
}
- protected MangaPagesNotFoundException(SerializationInfo info, StreamingContext context, Illustration illustration) : base(info, context)
- {
- Illustration = illustration;
- }
-
public MangaPagesNotFoundException(string? message, Illustration illustration) : base(message)
{
Illustration = illustration;
@@ -46,4 +40,4 @@ public class MangaPagesNotFoundException : MakoException
}
public Illustration Illustration { get; }
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/Global/Exception/RankingDateOutOfRangeException.cs b/src/Pixeval.CoreApi/Global/Exception/RankingDateOutOfRangeException.cs
index a1848fc3..9bfdc439 100644
--- a/src/Pixeval.CoreApi/Global/Exception/RankingDateOutOfRangeException.cs
+++ b/src/Pixeval.CoreApi/Global/Exception/RankingDateOutOfRangeException.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-using System.Runtime.Serialization;
namespace Pixeval.CoreApi.Global.Exception;
@@ -31,10 +30,6 @@ public class RankingDateOutOfRangeException : MakoException
{
}
- protected RankingDateOutOfRangeException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
-
public RankingDateOutOfRangeException(string? message) : base(message)
{
}
@@ -42,4 +37,4 @@ public class RankingDateOutOfRangeException : MakoException
public RankingDateOutOfRangeException(string? message, System.Exception? innerException) : base(message, innerException)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/Global/IMakoClientSupport.cs b/src/Pixeval.CoreApi/Global/IMakoClientSupport.cs
index 56a2fdf8..59520bc3 100644
--- a/src/Pixeval.CoreApi/Global/IMakoClientSupport.cs
+++ b/src/Pixeval.CoreApi/Global/IMakoClientSupport.cs
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-
namespace Pixeval.CoreApi.Global;
///
diff --git a/src/Pixeval.CoreApi/MakoClient.Engines.cs b/src/Pixeval.CoreApi/MakoClient.Engines.cs
index c5f90146..a489d6e2 100644
--- a/src/Pixeval.CoreApi/MakoClient.Engines.cs
+++ b/src/Pixeval.CoreApi/MakoClient.Engines.cs
@@ -312,7 +312,7 @@ public partial class MakoClient
public IFetchEngine NovelBookmarks(string uid, PrivacyPolicy privacyPolicy, TargetFilter targetFilter)
{
EnsureNotCancelled();
- CheckPrivacyPolicy(uid, privacyPolicy);
+ _ = CheckPrivacyPolicy(uid, privacyPolicy);
return new NovelBookmarkEngine(this, uid, privacyPolicy, targetFilter, new EngineHandle(CancelInstance));
}
diff --git a/src/Pixeval.CoreApi/MakoClient.Properties.cs b/src/Pixeval.CoreApi/MakoClient.Properties.cs
index 345a25b9..ca967685 100644
--- a/src/Pixeval.CoreApi/MakoClient.Properties.cs
+++ b/src/Pixeval.CoreApi/MakoClient.Properties.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -28,7 +28,7 @@ namespace Pixeval.CoreApi;
public partial class MakoClient
{
- private readonly List _runningInstances = new();
+ private readonly List _runningInstances = [];
///
/// The globally unique ID of current
@@ -47,4 +47,4 @@ public partial class MakoClient
internal IContainer MakoServices { get; init; }
public bool IsCancelled { get; set; }
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/MakoClient.cs b/src/Pixeval.CoreApi/MakoClient.cs
index 081e1aa4..0d8736e4 100644
--- a/src/Pixeval.CoreApi/MakoClient.cs
+++ b/src/Pixeval.CoreApi/MakoClient.cs
@@ -87,64 +87,64 @@ public partial class MakoClient : ICancellable
private IContainer BuildContainer()
{
var builder = new ContainerBuilder();
- builder.RegisterInstance(this).SingleInstance();
+ _ = builder.RegisterInstance(this).SingleInstance();
- builder.RegisterType().SingleInstance();
- builder.RegisterType().SingleInstance();
- builder.RegisterType().SingleInstance();
+ _ = builder.RegisterType().SingleInstance();
+ _ = builder.RegisterType().SingleInstance();
+ _ = builder.RegisterType().SingleInstance();
- builder.RegisterType().SingleInstance();
- builder.RegisterType().SingleInstance();
+ _ = builder.RegisterType().SingleInstance();
+ _ = builder.RegisterType().SingleInstance();
- builder.Register(static c => new MakoRetryHttpClientHandler(c.Resolve()))
+ _ = builder.Register(static c => new MakoRetryHttpClientHandler(c.Resolve()))
.Keyed(typeof(PixivApiHttpMessageHandler))
.As()
.PropertiesAutowired(static (info, _) => info.PropertyType == typeof(MakoClient))
.SingleInstance();
- builder.Register(static c => new MakoRetryHttpClientHandler(c.Resolve()))
+ _ = builder.Register(static c => new MakoRetryHttpClientHandler(c.Resolve()))
.Keyed(typeof(PixivImageHttpMessageHandler))
.As()
.PropertiesAutowired(static (info, _) => info.PropertyType == typeof(MakoClient))
.SingleInstance();
- builder.Register(static c => MakoHttpClient.Create(c.ResolveKeyed(typeof(PixivApiHttpMessageHandler)),
+ _ = builder.Register(static c => MakoHttpClient.Create(c.ResolveKeyed(typeof(PixivApiHttpMessageHandler)),
static client => client.BaseAddress = new Uri(MakoHttpOptions.AppApiBaseUrl)))
.Keyed(MakoApiKind.AppApi)
.As()
.SingleInstance();
- builder.Register(static c => MakoHttpClient.Create(c.ResolveKeyed(typeof(PixivApiHttpMessageHandler)),
+ _ = builder.Register(static c => MakoHttpClient.Create(c.ResolveKeyed(typeof(PixivApiHttpMessageHandler)),
static client => client.BaseAddress = new Uri(MakoHttpOptions.WebApiBaseUrl)))
.Keyed(MakoApiKind.WebApi)
.As()
.SingleInstance();
- builder.Register(static c => MakoHttpClient.Create(c.ResolveKeyed(typeof(PixivApiHttpMessageHandler)),
+ _ = builder.Register(static c => MakoHttpClient.Create(c.ResolveKeyed(typeof(PixivApiHttpMessageHandler)),
static client => client.BaseAddress = new Uri(MakoHttpOptions.OAuthBaseUrl)))
.Keyed(MakoApiKind.AuthApi)
.As()
.SingleInstance();
- builder.Register(static c => MakoHttpClient.Create(c.ResolveKeyed(typeof(PixivImageHttpMessageHandler)),
+ _ = builder.Register(static c => MakoHttpClient.Create(c.ResolveKeyed(typeof(PixivImageHttpMessageHandler)),
static client =>
{
- client.DefaultRequestHeaders.TryAddWithoutValidation("Referer", "https://www.pixiv.net");
- client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "PixivIOSApp/5.8.7");
+ _ = client.DefaultRequestHeaders.TryAddWithoutValidation("Referer", "https://www.pixiv.net");
+ _ = client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "PixivIOSApp/5.8.7");
}))
.Keyed(MakoApiKind.ImageApi)
.As()
.SingleInstance();
- builder.Register(static c => MakoHttpOptions.CreateHttpMessageInvoker(c.Resolve()))
+ _ = builder.Register(static c => MakoHttpOptions.CreateHttpMessageInvoker(c.Resolve()))
.Keyed(typeof(PixivApiNameResolver))
.As()
.SingleInstance();
- builder.Register(static c => MakoHttpOptions.CreateHttpMessageInvoker(c.Resolve()))
+ _ = builder.Register(static c => MakoHttpOptions.CreateHttpMessageInvoker(c.Resolve()))
.Keyed(typeof(PixivImageNameResolver))
.As()
.SingleInstance();
- builder.Register(static _ => MakoHttpOptions.CreateDirectHttpMessageInvoker())
+ _ = builder.Register(static _ => MakoHttpOptions.CreateDirectHttpMessageInvoker())
.Keyed(typeof(LocalMachineNameResolver))
.As()
.SingleInstance();
- builder.Register(static c =>
+ _ = builder.Register(static c =>
{
var context = c.Resolve(); // or a System.ObjectDisposedException will thrown because the 'c' cannot be hold
return RestService.For(c.ResolveKeyed(MakoApiKind.AppApi), new RefitSettings
@@ -153,7 +153,7 @@ public partial class MakoClient : ICancellable
});
});
- builder.Register(static c =>
+ _ = builder.Register(static c =>
{
var context = c.Resolve(); // or a System.ObjectDisposedException will thrown because the 'c' cannot be hold
return RestService.For(c.ResolveKeyed(MakoApiKind.AuthApi), new RefitSettings
@@ -162,7 +162,7 @@ public partial class MakoClient : ICancellable
});
});
- builder.Register(static c =>
+ _ = builder.Register(static c =>
{
var context = c.Resolve(); // or a System.ObjectDisposedException will thrown because the 'c' cannot be hold
return RestService.For("https://saucenao.com/", new RefitSettings
@@ -225,7 +225,7 @@ public partial class MakoClient : ICancellable
// removes an instance from the running instances list
private void CancelInstance(EngineHandle handle)
{
- _runningInstances.RemoveAll(instance => instance.EngineHandle == handle);
+ _ = _runningInstances.RemoveAll(instance => instance.EngineHandle == handle);
}
// PrivacyPolicy.Private is only allowed when the uid is pointing to yourself
diff --git a/src/Pixeval.CoreApi/Model/Illustration.cs b/src/Pixeval.CoreApi/Model/Illustration.cs
index 76668118..9221679b 100644
--- a/src/Pixeval.CoreApi/Model/Illustration.cs
+++ b/src/Pixeval.CoreApi/Model/Illustration.cs
@@ -113,7 +113,6 @@ public record Illustration : IIllustrate
return other?.Id == Id;
}
-
public class IllustrationMetaSinglePage
{
[JsonPropertyName("original_image_url")]
diff --git a/src/Pixeval.CoreApi/Model/TrendingTag.cs b/src/Pixeval.CoreApi/Model/TrendingTag.cs
index 47a9516a..935c977d 100644
--- a/src/Pixeval.CoreApi/Model/TrendingTag.cs
+++ b/src/Pixeval.CoreApi/Model/TrendingTag.cs
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-
namespace Pixeval.CoreApi.Model;
public record TrendingTag(string? Tag, string? Translation, Illustration? Illustration);
\ No newline at end of file
diff --git a/src/Pixeval.CoreApi/Net/MakoApiKind.cs b/src/Pixeval.CoreApi/Net/MakoApiKind.cs
index ed23347a..80c9d542 100644
--- a/src/Pixeval.CoreApi/Net/MakoApiKind.cs
+++ b/src/Pixeval.CoreApi/Net/MakoApiKind.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.CoreApi
+#region Copyright (c) Pixeval/Pixeval.CoreApi
// GPL v3 License
//
// Pixeval/Pixeval.CoreApi
@@ -18,7 +18,6 @@
// along with this program. If not, see .
#endregion
-
namespace Pixeval.CoreApi.Net;
///
@@ -30,4 +29,4 @@ public enum MakoApiKind
WebApi,
AuthApi,
ImageApi
-}
\ No newline at end of file
+}
diff --git a/src/Pixeval.CoreApi/Net/MakoHttpOptions.cs b/src/Pixeval.CoreApi/Net/MakoHttpOptions.cs
index a9dead8c..72794611 100644
--- a/src/Pixeval.CoreApi/Net/MakoHttpOptions.cs
+++ b/src/Pixeval.CoreApi/Net/MakoHttpOptions.cs
@@ -72,7 +72,6 @@ public static class MakoHttpOptions
return new HttpMessageInvoker(new SocketsHttpHandler());
}
-
private static Func> BypassedConnectCallback(INameResolver nameResolver)
{
return async (context, token) =>
diff --git a/src/Pixeval.CoreApi/Net/PixivApiHttpMessageHandler.cs b/src/Pixeval.CoreApi/Net/PixivApiHttpMessageHandler.cs
index 12f4cfae..8b89fbf9 100644
--- a/src/Pixeval.CoreApi/Net/PixivApiHttpMessageHandler.cs
+++ b/src/Pixeval.CoreApi/Net/PixivApiHttpMessageHandler.cs
@@ -41,14 +41,14 @@ internal class PixivApiHttpMessageHandler(MakoClient makoClient) : MakoClientSup
MakoHttpOptions.UseHttpScheme(request);
}
- headers.TryAddWithoutValidation("Accept-Language", MakoClient.Configuration.CultureInfo.Name);
+ _ = headers.TryAddWithoutValidation("Accept-Language", MakoClient.Configuration.CultureInfo.Name);
var session = MakoClient.Session;
switch (host)
{
case MakoHttpOptions.WebApiHost:
- headers.TryAddWithoutValidation("Cookie", session.Cookie);
+ _ = headers.TryAddWithoutValidation("Cookie", session.Cookie);
break;
case MakoHttpOptions.AppApiHost:
headers.Authorization = new AuthenticationHeaderValue("Bearer", session.AccessToken);
diff --git a/src/Pixeval.SourceGen/SettingsEntryGenerator.cs b/src/Pixeval.SourceGen/SettingsEntryGenerator.cs
index 1fc64a07..1b859e7d 100644
--- a/src/Pixeval.SourceGen/SettingsEntryGenerator.cs
+++ b/src/Pixeval.SourceGen/SettingsEntryGenerator.cs
@@ -30,7 +30,7 @@ namespace Pixeval.SourceGen;
[Generator]
public class SettingsEntryGenerator : IIncrementalGenerator
{
- private const string SettingPOCOAttributeFqName = "Pixeval.Attributes.SettingPOCO";
+ private const string SettingPocoAttributeFqName = "Pixeval.Attributes.SettingPoco";
private const string SyntheticSettingAttributeFqName = "Pixeval.Attributes.SyntheticSetting";
private const string SettingMetadataAttributeFqName = "Pixeval.Attributes.SettingMetadata";
private const string SettingEntryFqName = "global::Pixeval.SettingEntry";
@@ -42,7 +42,7 @@ public class SettingsEntryGenerator : IIncrementalGenerator
transform: static (ctx, _) =>
{
var tds = (TypeDeclarationSyntax)ctx.Node;
- (TypeDeclarationSyntax, IEnumerable<(PropertyDeclarationSyntax, AttributeSyntax?)>)? tuple = tds.HasAttribute(ctx.SemanticModel, SettingPOCOAttributeFqName)
+ (TypeDeclarationSyntax, IEnumerable<(PropertyDeclarationSyntax, AttributeSyntax?)>)? tuple = tds.HasAttribute(ctx.SemanticModel, SettingPocoAttributeFqName)
? (tds, tds.Members.OfType().Where(pds => !pds.HasAttribute(ctx.SemanticModel, SyntheticSettingAttributeFqName) && pds.HasAttribute(ctx.SemanticModel, SettingMetadataAttributeFqName))
.Select(property => (property, property.GetAttribute(ctx.SemanticModel, SettingMetadataAttributeFqName)))
.Where(tuple => tuple.Item2 is not null))
@@ -96,8 +96,8 @@ public class SettingsEntryGenerator : IIncrementalGenerator
ctx.ReportDiagnostic(
Diagnostic.Create(new DiagnosticDescriptor(
"PSG0001",
- "There should be only one [SettingPOCO] in an assembly",
- "There should be only one [SettingPOCO] in an assembly",
+ "There should be only one [SettingPoco] in an assembly",
+ "There should be only one [SettingPoco] in an assembly",
"SourceGen",
DiagnosticSeverity.Error,
true), typeDeclarationSyntax.GetLocation()));
diff --git a/src/Pixeval.Utilities/Enumerates.cs b/src/Pixeval.Utilities/Enumerates.cs
index 7e039dee..8b4b53d4 100644
--- a/src/Pixeval.Utilities/Enumerates.cs
+++ b/src/Pixeval.Utilities/Enumerates.cs
@@ -137,14 +137,14 @@ public static class Enumerates
public static T? FirstOrNull(this IEnumerable enumerable, Func predicate) where T : struct
{
var matches = enumerable.Where(predicate).Take(1).ToArray();
- return matches.Any() ? matches[0] : null;
+ return matches.Length is 0 ? null : matches[0];
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static T? FirstOrNull(this IEnumerable enumerable) where T : struct
{
var matches = enumerable.Take(1).ToArray();
- return matches.Any() ? matches[0] : null;
+ return matches.Length is 0 ? null : matches[0];
}
public static IAsyncEnumerable ToAsyncEnumerable(this IEnumerable source)
@@ -183,7 +183,7 @@ public static class Enumerates
public static void ReplaceByUpdate(this IList dest, IEnumerable source)
{
var enumerable = source as T[] ?? source.ToArray();
- if (enumerable.Any())
+ if (enumerable.Length != 0)
{
_ = dest.RemoveAll(x => !enumerable.Contains(x));
enumerable.Where(x => !dest.Contains(x)).ForEach(dest.Add);
@@ -197,7 +197,7 @@ public static class Enumerates
public static void ReplaceByUpdate(this ISet dest, IEnumerable source)
{
var enumerable = source as T[] ?? source.ToArray();
- if (enumerable.Any())
+ if (enumerable.Length != 0)
{
dest.ToArray().Where(x => !enumerable.Contains(x)).ForEach(x => dest.Remove(x));
dest.AddRange(enumerable);
diff --git a/src/Pixeval.Utilities/ObservableHashSet.cs b/src/Pixeval.Utilities/ObservableHashSet.cs
index 6adf88ee..d80004f0 100644
--- a/src/Pixeval.Utilities/ObservableHashSet.cs
+++ b/src/Pixeval.Utilities/ObservableHashSet.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval.Utilities
+#region Copyright (c) Pixeval/Pixeval.Utilities
// GPL v3 License
//
// Pixeval/Pixeval.Utilities
@@ -117,7 +117,7 @@ public class ObservableHashSet
void ICollection.Add(T item)
{
- Add(item);
+ _ = Add(item);
}
///
@@ -183,7 +183,7 @@ public class ObservableHashSet
OnCountPropertyChanging();
- _set.Remove(item);
+ _ = _set.Remove(item);
OnCollectionChanged(NotifyCollectionChangedAction.Remove, item);
@@ -233,7 +233,7 @@ public class ObservableHashSet
OnCountPropertyChanging();
- _set.Add(item);
+ _ = _set.Add(item);
OnCollectionChanged(NotifyCollectionChangedAction.Add, item);
@@ -555,5 +555,5 @@ internal static class ObservableHashSetSingletons
public static readonly PropertyChangedEventArgs CountPropertyChanged = new("Count");
public static readonly PropertyChangingEventArgs CountPropertyChanging = new("Count");
- public static readonly object[] NoItems = Array.Empty
public IReadOnlyDictionary ThumbnailStreams => ThumbnailStreamsRef;
- private Dictionary ThumbnailStreamsRef { get; } = new();
+ private Dictionary ThumbnailStreamsRef { get; } = [];
- private Dictionary> ThumbnailSourcesRef { get; } = new();
+ private Dictionary> ThumbnailSourcesRef { get; } = [];
private CancellationHandle LoadingThumbnailCancellationHandle { get; } = new();
diff --git a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorContentViewer.xaml.cs b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorContentViewer.xaml.cs
index 25b2cb0e..0e2b5e91 100644
--- a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorContentViewer.xaml.cs
+++ b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorContentViewer.xaml.cs
@@ -44,12 +44,14 @@ public sealed partial class IllustratorContentViewer : IDisposable
ViewModel.ShowExternalCommandBarChanged += (_, b) =>
{
- if (IllustratorContentViewerFrame.Content is IIllustratorContentViewerCommandBarHostSubPage subPage) subPage.ChangeCommandBarVisibility(b);
+ if (IllustratorContentViewerFrame.Content is IIllustratorContentViewerCommandBarHostSubPage subPage)
+ subPage.ChangeCommandBarVisibility(b);
};
ViewModel.ShowRecommendIllustratorsChanged += (_, b) =>
{
- if (b && !ViewModel.RecommendIllustrators.Any()) ViewModel.LoadRecommendIllustratorsAsync().Discard();
+ if (b && !ViewModel.RecommendIllustrators.Any())
+ ViewModel.LoadRecommendIllustratorsAsync().Discard();
};
ViewModel.CurrentTab = args.SelectedItemContainer.Tag switch
@@ -69,7 +71,7 @@ public sealed partial class IllustratorContentViewer : IDisposable
_lastNavigationViewTag = args.SelectedItemContainer.Tag as NavigationViewTag;
await ThreadingHelper.SpinWaitAsync(() => IllustratorContentViewerFrame.Content.GetType() != _lastNavigationViewTag!.NavigateTo);
- _pageCache.Add((Page)IllustratorContentViewerFrame.Content);
+ _ = _pageCache.Add((Page)IllustratorContentViewerFrame.Content);
}
private void NavigationViewAutoSuggestBox_OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
diff --git a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorContentViewerViewModel.cs b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorContentViewerViewModel.cs
index a140b66a..ad40c3fb 100644
--- a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorContentViewerViewModel.cs
+++ b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorContentViewerViewModel.cs
@@ -58,7 +58,7 @@ public partial class IllustratorContentViewerViewModel : ObservableObject
public IllustratorContentViewerViewModel(PixivSingleUserResponse userDetail)
{
- RecommendIllustrators = new();
+ RecommendIllustrators = [];
UserDetail = userDetail;
InitializeTags();
@@ -174,7 +174,7 @@ public partial class IllustratorContentViewerViewModel : ObservableObject
Metrics = new(profile?.TotalFollowUsers ?? 0, profile?.TotalMyPixivUsers ?? 0, profile?.TotalIllusts ?? 0);
Premium = profile?.IsPremium ?? false;
Following = UserDetail.UserEntity?.IsFollowed ?? false;
- ActionMenuFlyoutItems = new();
+ ActionMenuFlyoutItems = [];
}
private async Task SetAvatarAsync()
@@ -239,13 +239,13 @@ public partial class IllustratorContentViewerViewModel : ObservableObject
private void Follow(bool privately)
{
Following = true;
- App.AppViewModel.MakoClient.PostFollowUserAsync(UserDetail.UserEntity!.Id.ToString(), privately ? PrivacyPolicy.Private : PrivacyPolicy.Public);
+ _ = App.AppViewModel.MakoClient.PostFollowUserAsync(UserDetail.UserEntity!.Id.ToString(), privately ? PrivacyPolicy.Private : PrivacyPolicy.Public);
}
private void Unfollow()
{
Following = false;
- App.AppViewModel.MakoClient.RemoveFollowUserAsync(UserDetail.UserEntity!.Id.ToString());
+ _ = App.AppViewModel.MakoClient.RemoveFollowUserAsync(UserDetail.UserEntity!.Id.ToString());
}
public Visibility GetNavigationViewAutoSuggestBoxVisibility(bool showExternalCommandBar)
diff --git a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationAndMangaBookmarkPage.xaml.cs b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationAndMangaBookmarkPage.xaml.cs
index 0de6e57b..b13c14e5 100644
--- a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationAndMangaBookmarkPage.xaml.cs
+++ b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationAndMangaBookmarkPage.xaml.cs
@@ -34,9 +34,10 @@ public sealed partial class IllustratorIllustrationAndMangaBookmarkPage : ISorte
public override void OnPageActivated(NavigationEventArgs e)
{
- if (ActivationCount > 1) return;
+ if (ActivationCount > 1)
+ return;
- WeakReferenceMessenger.Default.TryRegister(this, static (recipient, _) => recipient.IllustrationContainer.ViewModel.DataProvider.FetchEngine?.Cancel());
+ _ = WeakReferenceMessenger.Default.TryRegister(this, static (recipient, _) => recipient.IllustrationContainer.ViewModel.DataProvider.FetchEngine?.Cancel());
if (e.Parameter is string id)
{
_uid = id;
diff --git a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationAndMangaBookmarkPageViewModel.cs b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationAndMangaBookmarkPageViewModel.cs
index 12e5d91a..aeb14c9d 100644
--- a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationAndMangaBookmarkPageViewModel.cs
+++ b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationAndMangaBookmarkPageViewModel.cs
@@ -40,7 +40,7 @@ public class IllustratorIllustrationAndMangaBookmarkPageViewModel : ObservableOb
private readonly CancellationTokenSource _bookmarksIdLoadingCancellationTokenSource = new();
- public ObservableCollection UserBookmarkTags { get; } = new();
+ public ObservableCollection UserBookmarkTags { get; } = [];
public event EventHandler? TagBookmarksIncrementallyLoaded;
@@ -66,7 +66,7 @@ public class IllustratorIllustrationAndMangaBookmarkPageViewModel : ObservableOb
var token = _bookmarksIdLoadingCancellationTokenSource.Token;
var engine = App.AppViewModel.MakoClient.UserTaggedBookmarksId(uid, tag);
var counter = 0;
- var hashSet = _bookmarkTagIllustrationIdDictionary.GetOrAdd(tag, new HashSet());
+ var hashSet = _bookmarkTagIllustrationIdDictionary.GetOrAdd(tag, []);
await foreach (var id in engine)
{
if (token.IsCancellationRequested)
@@ -82,7 +82,7 @@ public class IllustratorIllustrationAndMangaBookmarkPageViewModel : ObservableOb
TagBookmarksIncrementallyLoaded?.Invoke(this, tag);
}
- hashSet.Add(id);
+ _ = hashSet.Add(id);
counter++;
}
diff --git a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationPage.xaml.cs b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationPage.xaml.cs
index 5dfeb330..823bd7dc 100644
--- a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationPage.xaml.cs
+++ b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorIllustrationPage.xaml.cs
@@ -25,9 +25,10 @@ public sealed partial class IllustratorIllustrationPage : ISortedIllustrationCon
public override void OnPageActivated(NavigationEventArgs e)
{
- if (ActivationCount > 1) return;
+ if (ActivationCount > 1)
+ return;
- WeakReferenceMessenger.Default.TryRegister(this, static (recipient, _) => recipient.IllustrationContainer.ViewModel.DataProvider.FetchEngine?.Cancel());
+ _ = WeakReferenceMessenger.Default.TryRegister(this, static (recipient, _) => recipient.IllustrationContainer.ViewModel.DataProvider.FetchEngine?.Cancel());
if (e.Parameter is string id)
{
IllustrationContainer.IllustrationView.ViewModel.ResetEngineAndFillAsync(App.AppViewModel.MakoClient.Posts(id)).Discard();
diff --git a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorMangaPage.xaml.cs b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorMangaPage.xaml.cs
index b25d983e..db2b82fd 100644
--- a/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorMangaPage.xaml.cs
+++ b/src/Pixeval/UserControls/IllustratorContentViewer/IllustratorMangaPage.xaml.cs
@@ -25,9 +25,10 @@ public sealed partial class IllustratorMangaPage : ISortedIllustrationContainerP
public override void OnPageActivated(NavigationEventArgs e)
{
- if (ActivationCount > 1) return;
+ if (ActivationCount > 1)
+ return;
- WeakReferenceMessenger.Default.TryRegister(this, static (recipient, _) => recipient.IllustrationContainer.ViewModel.DataProvider.FetchEngine?.Cancel());
+ _ = WeakReferenceMessenger.Default.TryRegister(this, static (recipient, _) => recipient.IllustrationContainer.ViewModel.DataProvider.FetchEngine?.Cancel());
if (e.Parameter is string id)
{
IllustrationContainer.IllustrationView.ViewModel.ResetEngineAndFillAsync(App.AppViewModel.MakoClient.MangaPosts(id, App.AppViewModel.AppSetting.TargetFilter)).Discard();
diff --git a/src/Pixeval/UserControls/IllustratorView/IllustratorViewDataProvider.cs b/src/Pixeval/UserControls/IllustratorView/IllustratorViewDataProvider.cs
index 594ef23c..67619f95 100644
--- a/src/Pixeval/UserControls/IllustratorView/IllustratorViewDataProvider.cs
+++ b/src/Pixeval/UserControls/IllustratorView/IllustratorViewDataProvider.cs
@@ -39,7 +39,7 @@ public class IllustratorViewDataProvider : DataProvider _illustratorsSource;
protected set
{
- SetProperty(ref _illustratorsSource, value);
+ _ = SetProperty(ref _illustratorsSource, value);
View.Source = value;
}
}
diff --git a/src/Pixeval/UserControls/IllustratorView/IllustratorViewModel.cs b/src/Pixeval/UserControls/IllustratorView/IllustratorViewModel.cs
index 4a754c99..b20b95a5 100644
--- a/src/Pixeval/UserControls/IllustratorView/IllustratorViewModel.cs
+++ b/src/Pixeval/UserControls/IllustratorView/IllustratorViewModel.cs
@@ -45,7 +45,7 @@ namespace Pixeval.UserControls.IllustratorView;
public sealed partial class IllustratorViewModel : IllustrateViewModel
{
// Dominant color of the "No Image" image
- public static readonly SolidColorBrush DefaultAvatarBorderColorBrush = new(UIHelper.ParseHexColor("#D6DEE5"));
+ public static readonly SolidColorBrush DefaultAvatarBorderColorBrush = new(UiHelper.ParseHexColor("#D6DEE5"));
private readonly TaskCompletionSource _bannerImageTaskCompletionSource;
@@ -114,13 +114,13 @@ public sealed partial class IllustratorViewModel : IllustrateViewModel
var tasks = await Task.WhenAll(urls.Select(u => client.DownloadAsIRandomAccessStreamAsync(u)));
if (tasks is [Result.Success(var first), ..])
{
- var dominantColor = await UIHelper.GetDominantColorAsync(first.AsStreamForRead(), false);
+ var dominantColor = await UiHelper.GetDominantColorAsync(first.AsStreamForRead(), false);
AvatarBorderBrush = new SolidColorBrush(dominantColor);
}
var result = (await Task.WhenAll(tasks.SelectNotNull(r => r.BindAsync(s => s.GetSoftwareBitmapSourceAsync(true)))))
.SelectNotNull(res => res.GetOrElse(null)).ToArray();
- _bannerImageTaskCompletionSource.TrySetResult(result);
+ _ = _bannerImageTaskCompletionSource.TrySetResult(result);
return;
}
@@ -128,15 +128,15 @@ public sealed partial class IllustratorViewModel : IllustrateViewModel
if (UserDetail.UserProfile?.BackgroundImageUrl is { } url && await client.DownloadAsIRandomAccessStreamAsync(url) is Result.Success(var stream))
{
var managedStream = stream.AsStreamForRead();
- var dominantColor = await UIHelper.GetDominantColorAsync(managedStream, false);
+ var dominantColor = await UiHelper.GetDominantColorAsync(managedStream, false);
AvatarBorderBrush = new SolidColorBrush(dominantColor);
var result = Enumerates.ArrayOf(await stream.GetSoftwareBitmapSourceAsync(true));
- _bannerImageTaskCompletionSource.TrySetResult(result);
+ _ = _bannerImageTaskCompletionSource.TrySetResult(result);
return;
}
AvatarBorderBrush = DefaultAvatarBorderColorBrush;
- _bannerImageTaskCompletionSource.TrySetResult(Enumerates.ArrayOf(await AppContext.GetPixivNoProfileImageAsync()));
+ _ = _bannerImageTaskCompletionSource.TrySetResult(Enumerates.ArrayOf(await AppContext.GetPixivNoProfileImageAsync()));
}
// private void SetMetrics()
@@ -180,13 +180,13 @@ public sealed partial class IllustratorViewModel : IllustrateViewModel
private void GenerateLinkCommandOnExecuteRequested(XamlUICommand sender, ExecuteRequestedEventArgs args)
{
- UIHelper.ClipboardSetText(MakoHelper.GenerateIllustratorAppUri(UserId!).ToString());
+ UiHelper.ClipboardSetText(MakoHelper.GenerateIllustratorAppUri(UserId!).ToString());
TeachingTipProperties.ShowAndHide(IllustratorProfileResources.LinkCopiedToClipboard);
}
private void GenerateWebLinkCommandOnExecuteRequested(XamlUICommand sender, ExecuteRequestedEventArgs args)
{
- UIHelper.ClipboardSetText(MakoHelper.GenerateIllustratorWebUri(UserId!).ToString());
+ UiHelper.ClipboardSetText(MakoHelper.GenerateIllustratorWebUri(UserId!).ToString());
TeachingTipProperties.ShowAndHide(IllustratorProfileResources.LinkCopiedToClipboard);
}
@@ -208,18 +208,18 @@ public sealed partial class IllustratorViewModel : IllustrateViewModel
private void Follow()
{
IsFollowed = true;
- App.AppViewModel.MakoClient.PostFollowUserAsync(UserId!, PrivacyPolicy.Public);
+ _ = App.AppViewModel.MakoClient.PostFollowUserAsync(UserId!, PrivacyPolicy.Public);
}
private void Unfollow()
{
IsFollowed = false;
- App.AppViewModel.MakoClient.RemoveFollowUserAsync(UserId!);
+ _ = App.AppViewModel.MakoClient.RemoveFollowUserAsync(UserId!);
}
public override void Dispose()
{
- _bannerImageTaskCompletionSource.Task.ContinueWith(s => s.Dispose());
- BannerImageTask.ContinueWith(i => i.Dispose());
+ _ = _bannerImageTaskCompletionSource.Task.ContinueWith(s => s.Dispose());
+ _ = BannerImageTask.ContinueWith(i => i.Dispose());
}
}
diff --git a/src/Pixeval/UserControls/PixivReplyBar.xaml.cs b/src/Pixeval/UserControls/PixivReplyBar.xaml.cs
index 504601aa..9cc5a789 100644
--- a/src/Pixeval/UserControls/PixivReplyBar.xaml.cs
+++ b/src/Pixeval/UserControls/PixivReplyBar.xaml.cs
@@ -64,7 +64,7 @@ public sealed partial class PixivReplyBar
ReplyContentRichEditBox.Document.GetText(TextGetOptions.UseObjectText, out var content);
if (content.Length is 0 or > 140)
{
- MessageDialogBuilder.CreateAcknowledgement(this,
+ _ = MessageDialogBuilder.CreateAcknowledgement(this,
PixivReplyBarResources.CommentIsTooShortOrTooLongToastTitle,
PixivReplyBarResources.CommentIsTooShortOrTooLongToastContentFormatted.Format(content.Length));
return;
diff --git a/src/Pixeval/UserControls/RecommendIllustratorProfile/RecommendIllustratorProfile.xaml.cs b/src/Pixeval/UserControls/RecommendIllustratorProfile/RecommendIllustratorProfile.xaml.cs
index 3b25fd4c..466453ce 100644
--- a/src/Pixeval/UserControls/RecommendIllustratorProfile/RecommendIllustratorProfile.xaml.cs
+++ b/src/Pixeval/UserControls/RecommendIllustratorProfile/RecommendIllustratorProfile.xaml.cs
@@ -22,7 +22,7 @@ public sealed partial class RecommendIllustratorProfile
private void RecommendIllustratorProfile_OnLoaded(object sender, RoutedEventArgs e)
{
- ThreadingHelper.Fork(async () =>
+ _ = ThreadingHelper.Fork(async () =>
{
if (ViewModel.AvatarTask is { } task)
{
@@ -30,7 +30,7 @@ public sealed partial class RecommendIllustratorProfile
AvatarPersonPicture.ProfilePicture = result;
}
});
- ThreadingHelper.Fork(async () =>
+ _ = ThreadingHelper.Fork(async () =>
{
if (ViewModel.DisplayImagesTask is { } task)
{
diff --git a/src/Pixeval/UserControls/RecommendIllustratorProfile/RecommendIllustratorProfileViewModel.cs b/src/Pixeval/UserControls/RecommendIllustratorProfile/RecommendIllustratorProfileViewModel.cs
index 60f06f16..41d54ee8 100644
--- a/src/Pixeval/UserControls/RecommendIllustratorProfile/RecommendIllustratorProfileViewModel.cs
+++ b/src/Pixeval/UserControls/RecommendIllustratorProfile/RecommendIllustratorProfileViewModel.cs
@@ -84,23 +84,23 @@ public partial class RecommendIllustratorProfileViewModel : ObservableObject
public void Follow()
{
Followed = true;
- App.AppViewModel.MakoClient.PostFollowUserAsync(_userId, PrivacyPolicy.Public);
+ _ = App.AppViewModel.MakoClient.PostFollowUserAsync(_userId, PrivacyPolicy.Public);
}
public void Unfollow()
{
Followed = false;
- App.AppViewModel.MakoClient.RemoveFollowUserAsync(_userId);
+ _ = App.AppViewModel.MakoClient.RemoveFollowUserAsync(_userId);
}
public SolidColorBrush GetButtonBackground(bool isFollowed)
{
- return isFollowed ? new SolidColorBrush(UIHelper.ParseHexColor("#525252")) : new SolidColorBrush(UIHelper.ParseHexColor("#0096FA"));
+ return isFollowed ? new SolidColorBrush(UiHelper.ParseHexColor("#525252")) : new SolidColorBrush(UiHelper.ParseHexColor("#0096FA"));
}
public SolidColorBrush GetButtonForeground(bool isFollowed)
{
- return isFollowed ? new SolidColorBrush(UIHelper.ParseHexColor("#DBDBDB")) : new SolidColorBrush(UIHelper.ParseHexColor("#F5F5F5"));
+ return isFollowed ? new SolidColorBrush(UiHelper.ParseHexColor("#DBDBDB")) : new SolidColorBrush(UiHelper.ParseHexColor("#F5F5F5"));
}
public string GetFollowButtonText(bool isFollowed)
diff --git a/src/Pixeval/UserControls/TokenInput/TokenInput.xaml.cs b/src/Pixeval/UserControls/TokenInput/TokenInput.xaml.cs
index 1f313b22..683d0ad5 100644
--- a/src/Pixeval/UserControls/TokenInput/TokenInput.xaml.cs
+++ b/src/Pixeval/UserControls/TokenInput/TokenInput.xaml.cs
@@ -81,7 +81,7 @@ public sealed partial class TokenInput
TokenDeleting?.Invoke(this, arg);
if (!arg.Cancel)
{
- TokenSource.Remove(token);
+ _ = TokenSource.Remove(token);
TokenDeleted?.Invoke(this, token);
}
}
diff --git a/src/Pixeval/Util/IO/FileCache.cs b/src/Pixeval/Util/IO/FileCache.cs
index 2e92e598..08d24dac 100644
--- a/src/Pixeval/Util/IO/FileCache.cs
+++ b/src/Pixeval/Util/IO/FileCache.cs
@@ -56,10 +56,10 @@ public class FileCache
private FileCache()
{
- _supportedKeyTypes = new[] { typeof(int), typeof(uint), typeof(ulong), typeof(long) };
+ _supportedKeyTypes = [typeof(int), typeof(uint), typeof(ulong), typeof(long)];
- _index = new Dictionary();
- _expireIndex = new Dictionary();
+ _index = [];
+ _expireIndex = [];
_indexLocker = new SemaphoreSlim(1, 1);
_expireIndexLocker = new SemaphoreSlim(1, 1);
@@ -117,7 +117,7 @@ public class FileCache
}
finally
{
- _indexLocker.Release();
+ _ = _indexLocker.Release();
}
}
@@ -211,15 +211,15 @@ public class FileCache
{
foreach (var k in keys)
{
- (await _baseDirectory.TryGetItemAsync(HashToGuid(k).ToString("N")))?.DeleteAsync(StorageDeleteOption.PermanentDelete);
- _index.Remove(k);
+ _ = ((await _baseDirectory.TryGetItemAsync(HashToGuid(k).ToString("N")))?.DeleteAsync(StorageDeleteOption.PermanentDelete));
+ _ = _index.Remove(k);
}
await WriteIndexAsync();
}
finally
{
- _indexLocker.Release();
+ _ = _indexLocker.Release();
}
}
@@ -233,7 +233,7 @@ public class FileCache
try
{
- await Task.WhenAll(_index.Select(item => HashToGuid(item.Key))
+ _ = await Task.WhenAll(_index.Select(item => HashToGuid(item.Key))
.Select(guid => _baseDirectory.TryGetItemAsync(guid.ToString("N")).AsTask())
.Select(item => item.ContinueWith(t => t.Result?.DeleteAsync())));
_index.Clear();
@@ -241,7 +241,7 @@ public class FileCache
}
finally
{
- _indexLocker.Release();
+ _ = _indexLocker.Release();
}
}
@@ -260,7 +260,7 @@ public class FileCache
foreach (var (key, _) in expired)
{
await (await _baseDirectory.TryGetItemAsync(key.ToString("N")))?.DeleteAsync();
- _index.Remove(key);
+ _ = _index.Remove(key);
}
await WriteIndexAsync();
@@ -268,7 +268,7 @@ public class FileCache
}
finally
{
- _indexLocker.Release();
+ _ = _indexLocker.Release();
}
}
@@ -316,7 +316,7 @@ public class FileCache
}
finally
{
- _indexLocker.Release();
+ _ = _indexLocker.Release();
}
}
@@ -334,7 +334,7 @@ public class FileCache
? _expireIndex
.Where(x => x.Value >= DateTimeOffset.Now)
.ToList()
- : new List>();
+ : [];
if (state.HasFlag(CacheState.Expired))
{
@@ -349,7 +349,7 @@ public class FileCache
}
finally
{
- _indexLocker.Release();
+ _ = _indexLocker.Release();
}
}
@@ -406,7 +406,7 @@ public class FileCache
}
finally
{
- _indexLocker.Release();
+ _ = _indexLocker.Release();
}
throw new KeyNotFoundException(key.ToString());
@@ -451,7 +451,7 @@ public class FileCache
}
finally
{
- _indexLocker.Release();
+ _ = _indexLocker.Release();
}
}
@@ -499,7 +499,7 @@ public class FileCache
}
finally
{
- _indexLocker.Release();
+ _ = _indexLocker.Release();
}
}
@@ -546,7 +546,7 @@ public class FileCache
}
finally
{
- _expireIndexLocker.Release();
+ _ = _expireIndexLocker.Release();
}
}
diff --git a/src/Pixeval/Util/IO/IOHelper.Download.cs b/src/Pixeval/Util/IO/IOHelper.Download.cs
index 3ee3752d..a696caf0 100644
--- a/src/Pixeval/Util/IO/IOHelper.Download.cs
+++ b/src/Pixeval/Util/IO/IOHelper.Download.cs
@@ -37,7 +37,7 @@ using Pixeval.UserControls.IllustrationView;
namespace Pixeval.Util.IO;
-public static partial class IOHelper
+public static partial class IoHelper
{
private const int BlockSizeInBytes = 1024; // 1KB
@@ -49,7 +49,7 @@ public static partial class IOHelper
private const int MaximumSmallBufferPoolSizeInBytes = 24 * 1024 * BlockSizeInBytes; // 24MB
- private static readonly RecyclableMemoryStreamManager RecyclableMemoryStreamManager = new(
+ private static readonly RecyclableMemoryStreamManager _recyclableMemoryStreamManager = new(
BlockSizeInBytes,
LargeBufferMultipleInBytes,
MaxBufferSizeInBytes,
@@ -58,7 +58,7 @@ public static partial class IOHelper
// To avoid collecting stack trace, which is quite a time-consuming task
// and this exception is intended to be used at a massive magnitude
- private static readonly OperationCanceledException CancellationMark = new();
+ private static readonly OperationCanceledException _cancellationMark = new();
///
/// Attempts to download the content that are located by the argument
@@ -105,10 +105,10 @@ public static partial class IOHelper
using var response = await httpClient.GetResponseHeader(url);
if (response.Content.Headers.ContentLength is { } responseLength)
{
- response.EnsureSuccessStatusCode();
+ _ = response.EnsureSuccessStatusCode();
if (cancellationHandle?.IsCancelled is true)
{
- return Result.OfFailure(CancellationMark);
+ return Result.OfFailure(_cancellationMark);
}
await using var contentStream = await response.Content.ReadAsStreamAsync();
@@ -117,7 +117,7 @@ public static partial class IOHelper
// running, so we check the state right after the completion of that statement
if (cancellationHandle?.IsCancelled is true)
{
- return Result.OfFailure(CancellationMark);
+ return Result.OfFailure(_cancellationMark);
}
var resultStream = new MemoryStream();
@@ -129,7 +129,7 @@ public static partial class IOHelper
if (cancellationHandle?.IsCancelled is true)
{
await resultStream.DisposeAsync();
- return Result.OfFailure(CancellationMark);
+ return Result.OfFailure(_cancellationMark);
}
await resultStream.WriteAsync(buffer, 0, bytesRead);
@@ -143,11 +143,11 @@ public static partial class IOHelper
}
ArrayPool.Shared.Return(buffer, true);
- resultStream.Seek(0, SeekOrigin.Begin);
+ _ = resultStream.Seek(0, SeekOrigin.Begin);
return Result.OfSuccess(resultStream);
}
- return (await httpClient.DownloadByteArrayAsync(url)).Bind(m => (Stream)RecyclableMemoryStreamManager.GetStream(m.Span));
+ return (await httpClient.DownloadByteArrayAsync(url)).Bind(m => (Stream)_recyclableMemoryStreamManager.GetStream(m.Span));
}
catch (Exception e)
{
@@ -169,8 +169,8 @@ public static partial class IOHelper
public static async Task SaveAsAsync(this IllustrationViewModel viewModel)
{
IStorageItem? item = viewModel.IsManga
- ? await UIHelper.OpenFolderPickerAsync(PickerLocationId.PicturesLibrary)
- : await UIHelper.OpenFileSavePickerAsync(viewModel.Id, $"{viewModel.Illustrate.GetImageFormat().RemoveSurrounding(".", string.Empty)} file", viewModel.Illustrate.GetImageFormat());
+ ? await UiHelper.OpenFolderPickerAsync(PickerLocationId.PicturesLibrary)
+ : await UiHelper.OpenFileSavePickerAsync(viewModel.Id, $"{viewModel.Illustrate.GetImageFormat().RemoveSurrounding(".", string.Empty)} file", viewModel.Illustrate.GetImageFormat());
using var scope = App.AppViewModel.AppServicesScope;
var factory = scope.ServiceProvider.GetRequiredService>();
diff --git a/src/Pixeval/Util/IO/IOHelper.Imaging.cs b/src/Pixeval/Util/IO/IOHelper.Imaging.cs
index 99b4c3f4..7b40ce09 100644
--- a/src/Pixeval/Util/IO/IOHelper.Imaging.cs
+++ b/src/Pixeval/Util/IO/IOHelper.Imaging.cs
@@ -37,7 +37,7 @@ using SixLabors.ImageSharp.Formats.Webp;
namespace Pixeval.Util.IO;
-public static partial class IOHelper
+public static partial class IoHelper
{
///
/// Re-encode and decode the image that wrapped in . Note that this function
diff --git a/src/Pixeval/Util/IO/IOHelper.Mako.cs b/src/Pixeval/Util/IO/IOHelper.Mako.cs
index de9049ab..400b3538 100644
--- a/src/Pixeval/Util/IO/IOHelper.Mako.cs
+++ b/src/Pixeval/Util/IO/IOHelper.Mako.cs
@@ -26,7 +26,7 @@ using Pixeval.Utilities;
namespace Pixeval.Util.IO;
-public static partial class IOHelper
+public static partial class IoHelper
{
public static async Task> DownloadSoftwareBitmapSourceResultAsync(this MakoClient client, string url)
{
diff --git a/src/Pixeval/Util/IO/IOHelper.cs b/src/Pixeval/Util/IO/IOHelper.cs
index 95ea8623..7de48b39 100644
--- a/src/Pixeval/Util/IO/IOHelper.cs
+++ b/src/Pixeval/Util/IO/IOHelper.cs
@@ -40,7 +40,7 @@ using Windows.Storage.Streams;
namespace Pixeval.Util.IO;
-public static partial class IOHelper
+public static partial class IoHelper
{
public static async Task Sha1Async(this IRandomAccessStream randomAccessStream)
{
diff --git a/src/Pixeval/Util/PixivAuthenticationProxyServer.cs b/src/Pixeval/Util/PixivAuthenticationProxyServer.cs
index 2052ffea..061cef87 100644
--- a/src/Pixeval/Util/PixivAuthenticationProxyServer.cs
+++ b/src/Pixeval/Util/PixivAuthenticationProxyServer.cs
@@ -1,4 +1,4 @@
-#region Copyright (c) Pixeval/Pixeval
+#region Copyright (c) Pixeval/Pixeval
// GPL v3 License
//
// Pixeval/Pixeval
@@ -31,7 +31,7 @@ using Pixeval.Utilities;
namespace Pixeval.Util;
-public class PixivAuthenticationProxyServer : IDisposable
+public partial class PixivAuthenticationProxyServer : IDisposable
{
private readonly X509Certificate2? _certificate;
private readonly TcpListener? _tcpListener;
@@ -41,7 +41,7 @@ public class PixivAuthenticationProxyServer : IDisposable
_certificate = certificate;
_tcpListener = tcpListener;
_tcpListener.Start();
- _tcpListener.BeginAcceptTcpClient(AcceptTcpClientCallback, _tcpListener);
+ _ = _tcpListener.BeginAcceptTcpClient(AcceptTcpClientCallback, _tcpListener);
}
public void Dispose()
@@ -74,7 +74,7 @@ public class PixivAuthenticationProxyServer : IDisposable
if (result.AsyncState is TcpListener listener)
{
using var client = listener.EndAcceptTcpClient(result);
- listener.BeginAcceptTcpClient(AcceptTcpClientCallback, listener);
+ _ = listener.BeginAcceptTcpClient(AcceptTcpClientCallback, listener);
using (client)
{
var clientStream = client.GetStream();
@@ -95,11 +95,11 @@ public class PixivAuthenticationProxyServer : IDisposable
// use specify certificate to establish the HTTPS connection
await clientSsl.AuthenticateAsServerAsync(_certificate!, false, SslProtocols.None, false);
// create an HTTP connection to the target IP
- var host = Regex.Match(content, "CONNECT (?.+)\\:\\d+").Groups["host"].Value;
+ var host = HostRegex().Match(content).Groups["host"].Value;
var serverSsl = await CreateConnection(await GetTargetIp(host));
var request = Functions.IgnoreExceptionAsync(async () => await clientSsl.CopyToAsync(serverSsl));
var response = Functions.IgnoreExceptionAsync(async () => await serverSsl.CopyToAsync(clientSsl));
- await Task.WhenAny(request, response);
+ _ = await Task.WhenAny(request, response);
serverSsl.Close();
}
}
@@ -110,7 +110,6 @@ public class PixivAuthenticationProxyServer : IDisposable
}
}
-
private static async Task CreateConnection(IPAddress[] ipAddresses)
{
var client = new TcpClient();
@@ -128,4 +127,7 @@ public class PixivAuthenticationProxyServer : IDisposable
throw;
}
}
-}
\ No newline at end of file
+
+ [GeneratedRegex("CONNECT (?.+)\\:\\d+")]
+ private static partial Regex HostRegex();
+}
diff --git a/src/Pixeval/Util/Threading/ThreadingHelper.cs b/src/Pixeval/Util/Threading/ThreadingHelper.cs
index d2dfca59..d864b158 100644
--- a/src/Pixeval/Util/Threading/ThreadingHelper.cs
+++ b/src/Pixeval/Util/Threading/ThreadingHelper.cs
@@ -45,14 +45,15 @@ public static class ThreadingHelper
// nop
}
- public static Task ContinueWithFlatten(this Task task, Func> func)
+ public static Task
ContinueWithFlatten(this Task task, Func> func)
{
return task.ContinueWith(t => func(t.Result)).Unwrap();
}
public static void CompareExchange(ref int location1, int value, int comparand)
{
- while (Interlocked.CompareExchange(ref location1, value, comparand) != comparand) ;
+ while (Interlocked.CompareExchange(ref location1, value, comparand) != comparand)
+ ;
}
// fork a task from current context.
@@ -68,7 +69,7 @@ public static class ThreadingHelper
public static void DispatchTask(DispatcherQueueHandler action)
{
- CurrentContext.Window.DispatcherQueue.TryEnqueue(action);
+ _ = CurrentContext.Window.DispatcherQueue.TryEnqueue(action);
}
public static Task DispatchSyncTaskAsync(Func func)
@@ -89,15 +90,15 @@ public static class ThreadingHelper
public static Task EnqueueSyncTaskAsync(this DispatcherQueue dispatcher, Func function, DispatcherQueuePriority priority = DispatcherQueuePriority.Normal)
{
var taskCompletionSource = new TaskCompletionSource();
- dispatcher.TryEnqueue(priority, () =>
+ _ = dispatcher.TryEnqueue(priority, () =>
{
try
{
- taskCompletionSource.TrySetResult(function());
+ _ = taskCompletionSource.TrySetResult(function());
}
catch (Exception e)
{
- taskCompletionSource.TrySetException(e);
+ _ = taskCompletionSource.TrySetException(e);
}
});
return taskCompletionSource.Task;
diff --git a/src/Pixeval/Util/UI/Animating/IEasingFunction.cs b/src/Pixeval/Util/UI/Animating/IEasingFunction.cs
index cd2bb1bc..8d19000f 100644
--- a/src/Pixeval/Util/UI/Animating/IEasingFunction.cs
+++ b/src/Pixeval/Util/UI/Animating/IEasingFunction.cs
@@ -22,7 +22,7 @@ using System.Numerics;
namespace Pixeval.Util.UI.Animating;
-public interface IEasingFunction where V : INumber
+public interface IEasingFunction where TV : INumber
{
- V GetValue(double percentage);
+ TV GetValue(double percentage);
}
\ No newline at end of file
diff --git a/src/Pixeval/Util/UI/Animating/IValueAnimation.cs b/src/Pixeval/Util/UI/Animating/IValueAnimation.cs
index 05cde2fc..d6fb1d87 100644
--- a/src/Pixeval/Util/UI/Animating/IValueAnimation.cs
+++ b/src/Pixeval/Util/UI/Animating/IValueAnimation.cs
@@ -24,19 +24,19 @@ using System.Threading.Tasks;
namespace Pixeval.Util.UI.Animating;
-public interface IValueAnimation where V : INumber
+public interface IValueAnimation where TV : INumber
{
TimeSpan Duration { get; }
TimeSpan SampleRate { get; }
- V From { get; }
+ TV From { get; }
- V To { get; }
+ TV To { get; }
- IEasingFunction? EasingFunction { get; }
+ IEasingFunction? EasingFunction { get; }
- event Action OnValueChanged;
+ event Action OnValueChanged;
event EventHandler OnCompleted;
diff --git a/src/Pixeval/Util/UI/Animating/ValueAnimations.cs b/src/Pixeval/Util/UI/Animating/ValueAnimations.cs
index 12f57397..d6675f9e 100644
--- a/src/Pixeval/Util/UI/Animating/ValueAnimations.cs
+++ b/src/Pixeval/Util/UI/Animating/ValueAnimations.cs
@@ -28,13 +28,13 @@ namespace Pixeval.Util.UI.Animating;
public static class ValueAnimations
{
- internal static async IAsyncEnumerable StartAsync(IValueAnimation valueAnimation) where V : INumber
+ internal static async IAsyncEnumerable StartAsync(IValueAnimation valueAnimation) where TV : INumber
{
await Task.Yield();
var start = valueAnimation.From;
var sampleCount = (int)Math.Ceiling(valueAnimation.Duration.Divide(valueAnimation.SampleRate));
var by = valueAnimation.To - valueAnimation.From;
- var delta = by / V.Parse(sampleCount.ToString(), NumberStyles.Integer, null);
+ var delta = by / TV.Parse(sampleCount.ToString(), NumberStyles.Integer, null);
yield return start;
var counter = 1;
diff --git a/src/Pixeval/Util/UI/ReplyEmojiHelper.Enumerator.cs b/src/Pixeval/Util/UI/ReplyEmojiHelper.Enumerator.cs
index 8e0e90b0..3b60b28e 100644
--- a/src/Pixeval/Util/UI/ReplyEmojiHelper.Enumerator.cs
+++ b/src/Pixeval/Util/UI/ReplyEmojiHelper.Enumerator.cs
@@ -23,7 +23,6 @@ using System.Linq;
using System.Text;
using Pixeval.Misc;
-
namespace Pixeval.Util.UI;
public static partial class ReplyEmojiHelper
@@ -42,7 +41,7 @@ public static partial class ReplyEmojiHelper
{
while (!table.Keys.Contains(i) && i < content.Length)
{
- stringBuilder.Append(content[i++]);
+ _ = stringBuilder.Append(content[i++]);
}
if (stringBuilder.Length != 0)
@@ -55,7 +54,7 @@ public static partial class ReplyEmojiHelper
yield break;
}
- stringBuilder.Clear();
+ _ = stringBuilder.Clear();
var (emoji, length) = table[i];
yield return new ReplyContentToken.EmojiToken(emoji);
i += length;
diff --git a/src/Pixeval/Util/UI/ReplyEmojiHelper.cs b/src/Pixeval/Util/UI/ReplyEmojiHelper.cs
index 2c3f24a8..ef91c136 100644
--- a/src/Pixeval/Util/UI/ReplyEmojiHelper.cs
+++ b/src/Pixeval/Util/UI/ReplyEmojiHelper.cs
@@ -25,12 +25,11 @@ using System.Linq;
using System.Text.RegularExpressions;
using Pixeval.Misc;
-
namespace Pixeval.Util.UI;
public static partial class ReplyEmojiHelper
{
- private static readonly IReadOnlyDictionary StringToEmojiTable = BuildQueryTable();
+ private static readonly IReadOnlyDictionary _stringToEmojiTable = BuildQueryTable();
private static IReadOnlyDictionary BuildQueryTable()
{
@@ -56,12 +55,12 @@ public static partial class ReplyEmojiHelper
public static PixivReplyEmoji GetReplyEmojiFromPlaceholderKey(string content)
{
- return StringToEmojiTable[content];
+ return _stringToEmojiTable[content];
}
public static IReadOnlyDictionary BuildEmojiReplacementIndexTableOfReplyContent(string replyContent)
{
- return Regex.Matches(replyContent, string.Join("|", StringToEmojiTable.Keys.Select(Regex.Escape)))
- .ToImmutableDictionary(m => m.Index, m => (StringToEmojiTable[m.Value], m.Value.Length));
+ return Regex.Matches(replyContent, string.Join("|", _stringToEmojiTable.Keys.Select(Regex.Escape)))
+ .ToImmutableDictionary(m => m.Index, m => (_stringToEmojiTable[m.Value], m.Value.Length));
}
}
\ No newline at end of file
diff --git a/src/Pixeval/Util/UI/ToastNotificationHelper.cs b/src/Pixeval/Util/UI/ToastNotificationHelper.cs
index e86b3a8c..1fadd369 100644
--- a/src/Pixeval/Util/UI/ToastNotificationHelper.cs
+++ b/src/Pixeval/Util/UI/ToastNotificationHelper.cs
@@ -71,11 +71,11 @@ public static class ToastNotificationHelper
["progressValue"] = $"{progress.Normalize(100, 0):#.#}"
}
};
- ToastNotificationManager.CreateToastNotifier().Update(data, _tag);
+ _ = ToastNotificationManager.CreateToastNotifier().Update(data, _tag);
}
}
- private static readonly PropertyInfo AppLogoOverrideUriProperty = typeof(ToastContentBuilder).GetProperty("AppLogoOverrideUri", BindingFlags.NonPublic | BindingFlags.Instance)!;
+ private static readonly PropertyInfo _appLogoOverrideUriProperty = typeof(ToastContentBuilder).GetProperty("AppLogoOverrideUri", BindingFlags.NonPublic | BindingFlags.Instance)!;
public static ToastContentBuilder AddInlineImage(
this ToastContentBuilder builder,
@@ -134,7 +134,7 @@ public static class ToastNotificationHelper
appLogoOverrideUri.AddImageQuery = query;
}
- AppLogoOverrideUriProperty.SetValue(builder, appLogoOverrideUri);
+ _appLogoOverrideUriProperty.SetValue(builder, appLogoOverrideUri);
return builder;
}
@@ -148,7 +148,7 @@ public static class ToastNotificationHelper
contentBuilder?.Invoke(builder);
if (logoUri is not null)
{
- builder.AddAppLogoOverride(logoUri, ToastGenericAppLogoCrop.Default);
+ _ = builder.AddAppLogoOverride(logoUri, ToastGenericAppLogoCrop.Default);
}
builder.Show();
diff --git a/src/Pixeval/Util/UI/UIHelper.PInvoke.cs b/src/Pixeval/Util/UI/UIHelper.PInvoke.cs
index 2026e870..55ee6524 100644
--- a/src/Pixeval/Util/UI/UIHelper.PInvoke.cs
+++ b/src/Pixeval/Util/UI/UIHelper.PInvoke.cs
@@ -25,13 +25,13 @@ using Windows.ApplicationModel.DataTransfer;
namespace Pixeval.Util.UI;
-public static partial class UIHelper
+public static partial class UiHelper
{
// ReSharper disable once SuspiciousTypeConversion.Global
- private static readonly ITaskBarList3 TaskBarList3Instance = (ITaskBarList3)new TaskBarInstance();
+ private static readonly ITaskBarList3 _taskBarList3Instance = (ITaskBarList3)new TaskBarInstance();
// see https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/ShareSource/wpf/DataTransferManagerHelper.cs
- private static readonly Guid RiId = new(0xa5caee9b, 0x8708, 0x49d1, 0x8d, 0x36, 0x67, 0xd2, 0x5a, 0x8d, 0xa0, 0x0c);
+ private static readonly Guid _riId = new(0xa5caee9b, 0x8708, 0x49d1, 0x8d, 0x36, 0x67, 0xd2, 0x5a, 0x8d, 0xa0, 0x0c);
public static bool TaskBarCustomizationSupported => Environment.OSVersion.Version >= new Version(6, 1);
@@ -41,7 +41,7 @@ public static partial class UIHelper
{
if (TaskBarCustomizationSupported)
{
- TaskBarList3Instance.SetProgressState((nint)window.AppWindow.Id.Value, state);
+ _taskBarList3Instance.SetProgressState((nint)window.AppWindow.Id.Value, state);
}
}
@@ -49,7 +49,7 @@ public static partial class UIHelper
{
if (TaskBarCustomizationSupported)
{
- TaskBarList3Instance.SetProgressValue((nint)window.AppWindow.Id.Value, progressValue, max);
+ _taskBarList3Instance.SetProgressValue((nint)window.AppWindow.Id.Value, progressValue, max);
}
}
@@ -58,14 +58,14 @@ public static partial class UIHelper
{
var interop = DataTransferManager.As();
var manager = nint.Zero;
- fixed (Guid* id = &RiId)
+ fixed (Guid* id = &_riId)
{
interop.GetForWindow((nint)window.AppWindow.Id.Value, id, (void**)&manager);
return DataTransferManager.FromAbi(manager);
}
}
- public static void ShowShareUI(this Window window)
+ public static void ShowShareUi(this Window window)
{
DataTransferManagerInterop.ShowShareUIForWindow((nint)window.AppWindow.Id.Value);
}
diff --git a/src/Pixeval/Util/UI/UIHelper.cs b/src/Pixeval/Util/UI/UIHelper.cs
index 5a8c14b0..75865ab5 100644
--- a/src/Pixeval/Util/UI/UIHelper.cs
+++ b/src/Pixeval/Util/UI/UIHelper.cs
@@ -56,7 +56,7 @@ using Point = Windows.Foundation.Point;
namespace Pixeval.Util.UI;
-public static partial class UIHelper
+public static partial class UiHelper
{
///
/// With higher you will get brighter color and vice-versa.
@@ -142,7 +142,7 @@ public static partial class UIHelper
{
var transform = element.TransformToVisual((UIElement)scrollViewer.Content);
var position = transform.TransformPoint(new Point(0, 0));
- scrollViewer.ChangeView(null, position.Y, null, false);
+ _ = scrollViewer.ChangeView(null, position.Y, null, false);
}
public static Storyboard CreateStoryboard(params Timeline[] animations)
@@ -208,7 +208,7 @@ public static partial class UIHelper
{
if (sender.SelectedItem is NavigationViewItem { Tag: NavigationViewTag tag })
{
- frame.Navigate(tag.NavigateTo, tag.Parameter, transitionInfo ?? new SuppressNavigationTransitionInfo());
+ _ = frame.Navigate(tag.NavigateTo, tag.Parameter, transitionInfo ?? new SuppressNavigationTransitionInfo());
}
}
@@ -300,7 +300,7 @@ public static partial class UIHelper
var qrCodeData = qrCodeGen.CreateQrCode(urlPayload, QRCodeGenerator.ECCLevel.Q);
var qrCode = new BitmapByteQRCode(qrCodeData);
var bytes = qrCode.GetGraphic(20);
- return await (await IOHelper.GetRandomAccessStreamFromByteArrayAsync(bytes)).GetSoftwareBitmapSourceAsync(true);
+ return await (await IoHelper.GetRandomAccessStreamFromByteArrayAsync(bytes)).GetSoftwareBitmapSourceAsync(true);
}
public static async Task GenerateQrCodeAsync(string content)
@@ -309,7 +309,7 @@ public static partial class UIHelper
var qrCodeData = qrCodeGen.CreateQrCode(content, QRCodeGenerator.ECCLevel.Q);
var qrCode = new BitmapByteQRCode(qrCodeData);
var bytes = qrCode.GetGraphic(20);
- return await (await IOHelper.GetRandomAccessStreamFromByteArrayAsync(bytes)).GetSoftwareBitmapSourceAsync(true);
+ return await (await IoHelper.GetRandomAccessStreamFromByteArrayAsync(bytes)).GetSoftwareBitmapSourceAsync(true);
}
public static IAsyncOperation OpenFolderPickerAsync(PickerLocationId suggestedStartLocation)
diff --git a/src/Pixeval/Util/UI/XamlUICommandHelper.cs b/src/Pixeval/Util/UI/XamlUICommandHelper.cs
index 1dd1132c..1cb85de9 100644
--- a/src/Pixeval/Util/UI/XamlUICommandHelper.cs
+++ b/src/Pixeval/Util/UI/XamlUICommandHelper.cs
@@ -24,7 +24,7 @@ using Windows.System;
namespace Pixeval.Util.UI;
-public static class XamlUICommandHelper
+public static class XamlUiCommandHelper
{
public static XamlUICommand GetCommand(this string label, FontIconSymbols icon)
{
diff --git a/src/Pixeval/packages.lock.json b/src/Pixeval/packages.lock.json
index f390a81a..31a8388d 100644
--- a/src/Pixeval/packages.lock.json
+++ b/src/Pixeval/packages.lock.json
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
- "net8.0-windows10.0.19041": {
+ "net8.0-windows10.0.22621": {
"CommunityToolkit.Diagnostics": {
"type": "Direct",
"requested": "[8.2.2, )",
@@ -136,6 +136,15 @@
"Microsoft.Extensions.Options": "8.0.0"
}
},
+ "Microsoft.Graphics.Win2D": {
+ "type": "Direct",
+ "requested": "[1.1.0, )",
+ "resolved": "1.1.0",
+ "contentHash": "bHHnKtvoIGitm7EiOtENw3J1E9DSDAzJcrNhwve6nMvMoiFwtRnSZRO0mB1t0QYKhaZD6zM9Rq5kvBmiu4nelQ==",
+ "dependencies": {
+ "Microsoft.WindowsAppSDK": "1.4.230913002"
+ }
+ },
"Microsoft.IO.RecyclableMemoryStream": {
"type": "Direct",
"requested": "[2.3.2, )",
@@ -557,14 +566,6 @@
"resolved": "8.0.0",
"contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g=="
},
- "Microsoft.Graphics.Win2D": {
- "type": "Transitive",
- "resolved": "1.0.5.1",
- "contentHash": "9DVEVvyQWWz8kqhsFBAx9Zv4KRIAcmxuT7kFpK1Fgh6czSiMB+CQW0DlhZXT44Mtv41FRXG47lhEv+7a2YyiLA==",
- "dependencies": {
- "Microsoft.WindowsAppSDK": "1.0.4"
- }
- },
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "3.1.0",
@@ -671,7 +672,6 @@
"CommunityToolkit.Mvvm": "[8.2.2, )",
"CommunityToolkit.WinUI.Extensions": "[8.0.230907, )",
"CommunityToolkit.WinUI.Triggers": "[8.0.230907, )",
- "Microsoft.Graphics.Win2D": "[1.0.5.1, )",
"Microsoft.Windows.SDK.BuildTools": "[10.0.22621.2428, )",
"Microsoft.WindowsAppSDK": "[1.4.231008000, )",
"WinUI3Utilities": "[1.1.4.3, )"
@@ -692,7 +692,16 @@
}
}
},
- "net8.0-windows10.0.19041/win-arm64": {
+ "net8.0-windows10.0.22621/win-arm64": {
+ "Microsoft.Graphics.Win2D": {
+ "type": "Direct",
+ "requested": "[1.1.0, )",
+ "resolved": "1.1.0",
+ "contentHash": "bHHnKtvoIGitm7EiOtENw3J1E9DSDAzJcrNhwve6nMvMoiFwtRnSZRO0mB1t0QYKhaZD6zM9Rq5kvBmiu4nelQ==",
+ "dependencies": {
+ "Microsoft.WindowsAppSDK": "1.4.230913002"
+ }
+ },
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.4.231008000, )",
@@ -702,14 +711,6 @@
"Microsoft.Windows.SDK.BuildTools": "10.0.22621.1"
}
},
- "Microsoft.Graphics.Win2D": {
- "type": "Transitive",
- "resolved": "1.0.5.1",
- "contentHash": "9DVEVvyQWWz8kqhsFBAx9Zv4KRIAcmxuT7kFpK1Fgh6czSiMB+CQW0DlhZXT44Mtv41FRXG47lhEv+7a2YyiLA==",
- "dependencies": {
- "Microsoft.WindowsAppSDK": "1.0.4"
- }
- },
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "4.7.0",
@@ -761,7 +762,16 @@
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
}
},
- "net8.0-windows10.0.19041/win-x64": {
+ "net8.0-windows10.0.22621/win-x64": {
+ "Microsoft.Graphics.Win2D": {
+ "type": "Direct",
+ "requested": "[1.1.0, )",
+ "resolved": "1.1.0",
+ "contentHash": "bHHnKtvoIGitm7EiOtENw3J1E9DSDAzJcrNhwve6nMvMoiFwtRnSZRO0mB1t0QYKhaZD6zM9Rq5kvBmiu4nelQ==",
+ "dependencies": {
+ "Microsoft.WindowsAppSDK": "1.4.230913002"
+ }
+ },
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.4.231008000, )",
@@ -771,14 +781,6 @@
"Microsoft.Windows.SDK.BuildTools": "10.0.22621.1"
}
},
- "Microsoft.Graphics.Win2D": {
- "type": "Transitive",
- "resolved": "1.0.5.1",
- "contentHash": "9DVEVvyQWWz8kqhsFBAx9Zv4KRIAcmxuT7kFpK1Fgh6czSiMB+CQW0DlhZXT44Mtv41FRXG47lhEv+7a2YyiLA==",
- "dependencies": {
- "Microsoft.WindowsAppSDK": "1.0.4"
- }
- },
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "4.7.0",
@@ -830,7 +832,16 @@
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
}
},
- "net8.0-windows10.0.19041/win-x86": {
+ "net8.0-windows10.0.22621/win-x86": {
+ "Microsoft.Graphics.Win2D": {
+ "type": "Direct",
+ "requested": "[1.1.0, )",
+ "resolved": "1.1.0",
+ "contentHash": "bHHnKtvoIGitm7EiOtENw3J1E9DSDAzJcrNhwve6nMvMoiFwtRnSZRO0mB1t0QYKhaZD6zM9Rq5kvBmiu4nelQ==",
+ "dependencies": {
+ "Microsoft.WindowsAppSDK": "1.4.230913002"
+ }
+ },
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.4.231008000, )",
@@ -840,14 +851,6 @@
"Microsoft.Windows.SDK.BuildTools": "10.0.22621.1"
}
},
- "Microsoft.Graphics.Win2D": {
- "type": "Transitive",
- "resolved": "1.0.5.1",
- "contentHash": "9DVEVvyQWWz8kqhsFBAx9Zv4KRIAcmxuT7kFpK1Fgh6czSiMB+CQW0DlhZXT44Mtv41FRXG47lhEv+7a2YyiLA==",
- "dependencies": {
- "Microsoft.WindowsAppSDK": "1.0.4"
- }
- },
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "4.7.0",