mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-05-01 10:12:31 +00:00
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:
@@ -3,20 +3,19 @@ using System.Globalization;
|
||||
using System.Runtime.CompilerServices;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using DiscordChatExporter.Gui.Services;
|
||||
using DiscordChatExporter.Gui.Utils;
|
||||
using DiscordChatExporter.Gui.Utils.Extensions;
|
||||
using PowerKit;
|
||||
using PowerKit.Extensions;
|
||||
|
||||
namespace DiscordChatExporter.Gui.Localization;
|
||||
|
||||
public partial class LocalizationManager : ObservableObject, IDisposable
|
||||
{
|
||||
private readonly DisposableCollector _eventRoot = new();
|
||||
private readonly IDisposable _eventSubscription;
|
||||
|
||||
public LocalizationManager(SettingsService settingsService)
|
||||
{
|
||||
_eventRoot.Add(settingsService.WatchProperty(o => o.Language, v => Language = v, true));
|
||||
|
||||
_eventRoot.Add(
|
||||
_eventSubscription = Disposable.Merge(
|
||||
settingsService.WatchProperty(o => o.Language, v => Language = v, true),
|
||||
this.WatchProperty(
|
||||
o => o.Language,
|
||||
_ =>
|
||||
@@ -66,7 +65,7 @@ public partial class LocalizationManager : ObservableObject, IDisposable
|
||||
return $"Missing localization for '{key}'";
|
||||
}
|
||||
|
||||
public void Dispose() => _eventRoot.Dispose();
|
||||
public void Dispose() => _eventSubscription.Dispose();
|
||||
}
|
||||
|
||||
public partial class LocalizationManager
|
||||
|
||||
Reference in New Issue
Block a user