mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-01-08 01:42:49 +01:00
40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using System;
|
|
using Avalonia.Controls;
|
|
using DHT.Desktop.App.Controls;
|
|
using DHT.Desktop.App.Dialogs.Message;
|
|
using DHT.Desktop.Server;
|
|
using DHT.Server.Database;
|
|
using DHT.Utils.Models;
|
|
|
|
namespace DHT.Desktop.App.Pages;
|
|
|
|
sealed class AdvancedPageModel : BaseModel, IDisposable {
|
|
public ServerConfigurationPanelModel ServerConfigurationModel { get; }
|
|
|
|
private readonly Window window;
|
|
private readonly IDatabaseFile db;
|
|
|
|
[Obsolete("Designer")]
|
|
public AdvancedPageModel() : this(null!, DummyDatabaseFile.Instance, new ServerManager(DummyDatabaseFile.Instance)) {}
|
|
|
|
public AdvancedPageModel(Window window, IDatabaseFile db, ServerManager serverManager) {
|
|
this.window = window;
|
|
this.db = db;
|
|
|
|
ServerConfigurationModel = new ServerConfigurationPanelModel(window, serverManager);
|
|
}
|
|
|
|
public void Initialize() {
|
|
ServerConfigurationModel.Initialize();
|
|
}
|
|
|
|
public void Dispose() {
|
|
ServerConfigurationModel.Dispose();
|
|
}
|
|
|
|
public async void VacuumDatabase() {
|
|
db.Vacuum();
|
|
await Dialog.ShowOk(window, "Vacuum Database", "Done.");
|
|
}
|
|
}
|