Add BackupAndRestore

This commit is contained in:
2dust
2024-10-04 15:22:32 +08:00
parent 90ba80436d
commit fe81b51dcb
6 changed files with 313 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.ReactiveUI;
using Avalonia.Threading;
using DialogHostAvalonia;
using ReactiveUI;
using Splat;
using System.ComponentModel;
@@ -19,6 +20,7 @@ namespace v2rayN.Desktop.Views
{
private static Config _config;
private WindowNotificationManager? _manager;
private BackupAndRestoreView? _backupAndRestoreView;
public MainWindow()
{
@@ -34,6 +36,7 @@ namespace v2rayN.Desktop.Views
menuSettingsSetUWP.Click += menuSettingsSetUWP_Click;
menuPromotion.Click += menuPromotion_Click;
menuClose.Click += menuClose_Click;
menuBackupAndRestore.Click += MenuBackupAndRestore_Click;
var IsAdministrator = true;//WindowsUtils.IsAdministrator();
MessageBus.Current.Listen<string>(Global.CommandSendSnackMsg).Subscribe(x => DelegateSnackMsg(x));
@@ -365,6 +368,12 @@ namespace v2rayN.Desktop.Views
//ViewModel?.ScanScreenTaskAsync(result);
}
private void MenuBackupAndRestore_Click(object sender, RoutedEventArgs e)
{
_backupAndRestoreView ??= new BackupAndRestoreView(this);
DialogHost.Show(_backupAndRestoreView);
}
#endregion Event
#region UI