This commit is contained in:
Lightczx
2023-12-26 10:42:30 +08:00
parent 371e469db7
commit acdcee7558
8 changed files with 9 additions and 11 deletions

View File

@@ -1,6 +1,8 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Core.ExceptionService;
namespace Snap.Hutao.Factory.Progress;
[ConstructorGenerated]
@@ -11,6 +13,11 @@ internal sealed partial class ProgressFactory : IProgressFactory
public IProgress<T> CreateForMainThread<T>(Action<T> handler)
{
return new DispatcherQueueProgress<T>(handler, taskContext.SynchronizationContext);
if (taskContext is not ITaskContextUnsafe @unsafe)
{
throw ThrowHelper.NotSupported();
}
return new DispatcherQueueProgress<T>(handler, @unsafe.DispatcherQueue);
}
}

View File

@@ -7,7 +7,6 @@ using Snap.Hutao.Service.Abstraction;
using Snap.Hutao.Web.Hoyolab;
using Snap.Hutao.Web.Hoyolab.Hk4e.Common.Announcement;
using Snap.Hutao.Web.Response;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;

View File

@@ -1,14 +1,12 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.Extensions.Primitives;
using Snap.Hutao.Core.Windowing;
using Snap.Hutao.Model;
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Service.Abstraction;
using Snap.Hutao.Web.Hoyolab;
using System.Globalization;
using System.IO;
namespace Snap.Hutao.Service;

View File

@@ -2,10 +2,7 @@
// Licensed under the MIT license.
using Microsoft.Win32;
using Snap.Hutao.Core.ExceptionService;
using Snap.Hutao.Model.Entity;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;

View File

@@ -2,7 +2,6 @@
// Licensed under the MIT license.
using CommunityToolkit.WinUI.Converters;
using Snap.Hutao.Control;
namespace Snap.Hutao.View.Converter;

View File

@@ -20,7 +20,7 @@ namespace Snap.Hutao.View;
[INotifyPropertyChanged]
internal sealed partial class TitleView : UserControl
{
private CancellationTokenSource checkUpdateTaskCancellationTokenSource = new();
private readonly CancellationTokenSource checkUpdateTaskCancellationTokenSource = new();
private UpdateStatus? updateStatus;
public TitleView()

View File

@@ -4,7 +4,6 @@
using Microsoft.UI.Xaml.Controls;
using Microsoft.Windows.AppLifecycle;
using Snap.Hutao.Core;
using Snap.Hutao.Core.IO;
using Snap.Hutao.Core.IO.DataTransfer;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Core.Shell;

View File

@@ -12,7 +12,6 @@ using Snap.Hutao.Web.Hoyolab.Bbs.User;
using Snap.Hutao.Web.Hoyolab.DataSigning;
using Snap.Hutao.Web.Hoyolab.Takumi.Auth;
using Snap.Hutao.Web.Response;
using System.Runtime.InteropServices;
using System.Text;
using Windows.Foundation;