Add PowerKit and replace custom utility extensions (#1525)

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot
2026-04-19 23:10:45 +03:00
committed by GitHub
parent 757daa7a60
commit 7456f0fe3a
75 changed files with 133 additions and 603 deletions

View File

@@ -10,15 +10,14 @@ using DiscordChatExporter.Core.Discord;
using DiscordChatExporter.Core.Discord.Data;
using DiscordChatExporter.Core.Exceptions;
using DiscordChatExporter.Core.Exporting;
using DiscordChatExporter.Core.Utils.Extensions;
using DiscordChatExporter.Gui.Framework;
using DiscordChatExporter.Gui.Localization;
using DiscordChatExporter.Gui.Models;
using DiscordChatExporter.Gui.Services;
using DiscordChatExporter.Gui.Utils;
using DiscordChatExporter.Gui.Utils.Extensions;
using Gress;
using Gress.Completable;
using PowerKit;
using PowerKit.Extensions;
namespace DiscordChatExporter.Gui.ViewModels.Components;
@@ -29,7 +28,7 @@ public partial class DashboardViewModel : ViewModelBase
private readonly DialogManager _dialogManager;
private readonly SettingsService _settingsService;
private readonly DisposableCollector _eventRoot = new();
private readonly IDisposable _eventSubscription;
private readonly AutoResetProgressMuxer _progressMuxer;
private DiscordClient? _discord;
@@ -50,14 +49,11 @@ public partial class DashboardViewModel : ViewModelBase
_progressMuxer = Progress.CreateMuxer().WithAutoReset();
_eventRoot.Add(
_eventSubscription = Disposable.Merge(
Progress.WatchProperty(
o => o.Current,
_ => OnPropertyChanged(nameof(IsProgressIndeterminate))
)
);
_eventRoot.Add(
),
SelectedChannels.WatchProperty(
o => o.Count,
_ => ExportCommand.NotifyCanExecuteChanged()
@@ -332,7 +328,7 @@ public partial class DashboardViewModel : ViewModelBase
{
if (disposing)
{
_eventRoot.Dispose();
_eventSubscription.Dispose();
}
base.Dispose(disposing);