|
|
@ -7,6 +7,7 @@ using Microsoft.Win32;
|
|
|
|
using ReactiveUI;
|
|
|
|
using ReactiveUI;
|
|
|
|
using ReactiveUI.Fody.Helpers;
|
|
|
|
using ReactiveUI.Fody.Helpers;
|
|
|
|
using Splat;
|
|
|
|
using Splat;
|
|
|
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Drawing;
|
|
|
|
using System.Drawing;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
using System.Reactive;
|
|
|
|
using System.Reactive;
|
|
|
@ -121,6 +122,7 @@ namespace v2rayN.ViewModels
|
|
|
|
public ReactiveCommand<Unit, Unit> OptionSettingCmd { get; }
|
|
|
|
public ReactiveCommand<Unit, Unit> OptionSettingCmd { get; }
|
|
|
|
public ReactiveCommand<Unit, Unit> RoutingSettingCmd { get; }
|
|
|
|
public ReactiveCommand<Unit, Unit> RoutingSettingCmd { get; }
|
|
|
|
public ReactiveCommand<Unit, Unit> GlobalHotkeySettingCmd { get; }
|
|
|
|
public ReactiveCommand<Unit, Unit> GlobalHotkeySettingCmd { get; }
|
|
|
|
|
|
|
|
public ReactiveCommand<Unit, Unit> RebootAsAdminCmd { get; }
|
|
|
|
public ReactiveCommand<Unit, Unit> ClearServerStatisticsCmd { get; }
|
|
|
|
public ReactiveCommand<Unit, Unit> ClearServerStatisticsCmd { get; }
|
|
|
|
public ReactiveCommand<Unit, Unit> ImportOldGuiConfigCmd { get; }
|
|
|
|
public ReactiveCommand<Unit, Unit> ImportOldGuiConfigCmd { get; }
|
|
|
|
|
|
|
|
|
|
|
@ -431,6 +433,10 @@ namespace v2rayN.ViewModels
|
|
|
|
_noticeHandler?.Enqueue(ResUI.OperationSuccess);
|
|
|
|
_noticeHandler?.Enqueue(ResUI.OperationSuccess);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
RebootAsAdminCmd = ReactiveCommand.Create(() =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
RebootAsAdmin();
|
|
|
|
|
|
|
|
});
|
|
|
|
ClearServerStatisticsCmd = ReactiveCommand.Create(() =>
|
|
|
|
ClearServerStatisticsCmd = ReactiveCommand.Create(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_statistics?.ClearAllServerStatistics();
|
|
|
|
_statistics?.ClearAllServerStatistics();
|
|
|
@ -1292,6 +1298,24 @@ namespace v2rayN.ViewModels
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void RebootAsAdmin()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ProcessStartInfo startInfo = new()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UseShellExecute = true,
|
|
|
|
|
|
|
|
Arguments = Global.RebootAs,
|
|
|
|
|
|
|
|
WorkingDirectory = Utils.StartupPath(),
|
|
|
|
|
|
|
|
FileName = Utils.GetExePath(),
|
|
|
|
|
|
|
|
Verb = "runas",
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Process.Start(startInfo);
|
|
|
|
|
|
|
|
MyAppExit(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch { }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ImportOldGuiConfig()
|
|
|
|
private void ImportOldGuiConfig()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
OpenFileDialog fileDialog = new()
|
|
|
|
OpenFileDialog fileDialog = new()
|
|
|
|