diff --git a/v2rayN/ServiceLib/Common/FileManager.cs b/v2rayN/ServiceLib/Common/FileManager.cs index ee0eaa98e3..95a17adb3d 100644 --- a/v2rayN/ServiceLib/Common/FileManager.cs +++ b/v2rayN/ServiceLib/Common/FileManager.cs @@ -115,6 +115,5 @@ public static bool CreateFromDirectory(string sourceDirectoryName, string destin } return true; } - } } \ No newline at end of file diff --git a/v2rayN/ServiceLib/Enums/EViewAction.cs b/v2rayN/ServiceLib/Enums/EViewAction.cs index acacbd6a47..d62943c616 100644 --- a/v2rayN/ServiceLib/Enums/EViewAction.cs +++ b/v2rayN/ServiceLib/Enums/EViewAction.cs @@ -39,7 +39,7 @@ public enum EViewAction DispatcherRefreshServersBiz, DispatcherRefreshIcon, DispatcherCheckUpdate, - DispatcherCheckUpdateFinished, + DispatcherCheckUpdateFinished, DispatcherShowMsg, } } \ No newline at end of file diff --git a/v2rayN/ServiceLib/Handler/LazyConfig.cs b/v2rayN/ServiceLib/Handler/LazyConfig.cs index 2fba1116a5..55b7be8893 100644 --- a/v2rayN/ServiceLib/Handler/LazyConfig.cs +++ b/v2rayN/ServiceLib/Handler/LazyConfig.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace ServiceLib.Handler +namespace ServiceLib.Handler { public sealed class LazyConfig { diff --git a/v2rayN/ServiceLib/Models/CheckUpdateItem.cs b/v2rayN/ServiceLib/Models/CheckUpdateItem.cs index d3886d41bc..9d21e20ef0 100644 --- a/v2rayN/ServiceLib/Models/CheckUpdateItem.cs +++ b/v2rayN/ServiceLib/Models/CheckUpdateItem.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ServiceLib.Models +namespace ServiceLib.Models { public class CheckUpdateItem { @@ -14,4 +8,4 @@ public class CheckUpdateItem public string? fileName { get; set; } public bool? isFinished { get; set; } } -} +} \ No newline at end of file diff --git a/v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs b/v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs index 46f604b159..f2911c9a09 100644 --- a/v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs @@ -9,6 +9,7 @@ public class AddServer2ViewModel : MyReactiveObject { [Reactive] public ProfileItem SelectedSource { get; set; } + [Reactive] public string? CoreType { get; set; } diff --git a/v2rayN/ServiceLib/ViewModels/MsgViewModel.cs b/v2rayN/ServiceLib/ViewModels/MsgViewModel.cs index 53e6c43882..e638410646 100644 --- a/v2rayN/ServiceLib/ViewModels/MsgViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MsgViewModel.cs @@ -2,7 +2,6 @@ using ReactiveUI.Fody.Helpers; using Splat; using System.Collections.Concurrent; -using System.Diagnostics; using System.Text.RegularExpressions; namespace ServiceLib.ViewModels diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index a14c92e836..c35b7979bb 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -279,6 +279,7 @@ private async Task UpdateViewHandler(EViewAction action, object? obj) var clipboardData = await AvaUtils.GetClipboardData(this); ViewModel?.AddServerViaClipboardAsync(clipboardData); break; + case EViewAction.AdjustMainLvColWidth: Dispatcher.UIThread.Post(() => Locator.Current.GetService()?.AutofitColumnWidthAsync(), diff --git a/v2rayN/v2rayN/App.xaml b/v2rayN/v2rayN/App.xaml index 04a602cb6f..3b7aefeec9 100644 --- a/v2rayN/v2rayN/App.xaml +++ b/v2rayN/v2rayN/App.xaml @@ -1,9 +1,9 @@  diff --git a/v2rayN/v2rayN/Views/CheckUpdateView.xaml b/v2rayN/v2rayN/Views/CheckUpdateView.xaml index e20138a3a5..fcd11a524f 100644 --- a/v2rayN/v2rayN/Views/CheckUpdateView.xaml +++ b/v2rayN/v2rayN/Views/CheckUpdateView.xaml @@ -56,7 +56,6 @@ IsCancel="True" IsDefault="True" Style="{StaticResource MaterialDesignFlatButton}" /> - @@ -106,7 +105,6 @@ - \ No newline at end of file diff --git a/v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs b/v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs index 9f9b4fd2c7..def6e53ff8 100644 --- a/v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs +++ b/v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs @@ -34,6 +34,7 @@ private async Task UpdateViewHandler(EViewAction action, object? obj) ViewModel?.UpdateViewResult((CheckUpdateItem)obj); }), DispatcherPriority.Normal); break; + case EViewAction.DispatcherCheckUpdateFinished: if (obj is null) return false; Application.Current?.Dispatcher.Invoke((() => @@ -41,7 +42,6 @@ private async Task UpdateViewHandler(EViewAction action, object? obj) ViewModel?.UpdateFinishedResult((bool)obj); }), DispatcherPriority.Normal); break; - } return await Task.FromResult(true); diff --git a/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs b/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs index e776c7ae2a..df6547382d 100644 --- a/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs @@ -15,7 +15,6 @@ public GlobalHotkeySettingWindow() { InitializeComponent(); - this.Owner = Application.Current.MainWindow; _config = LazyConfig.Instance.Config; _config.globalHotkeys ??= new List(); diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index 8d826d922e..041f7f2e34 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -15,7 +15,7 @@ namespace v2rayN.Views { public partial class MainWindow { - private static Config _config; + private static Config _config; private CheckUpdateView? _checkUpdateView; public MainWindow() @@ -296,7 +296,7 @@ private async Task UpdateViewHandler(EViewAction action, object? obj) Application.Current?.Dispatcher.Invoke((() => { Application.Current.Shutdown(); - }), DispatcherPriority.Normal); + }), DispatcherPriority.Normal); break; case EViewAction.ScanScreenTask: diff --git a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml index c63fa71a71..1292f71448 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml +++ b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml @@ -1,14 +1,14 @@