From a6f27e507131f51bc3a477666955ea809f2a352e Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:30:45 +0800 Subject: [PATCH] Code clean --- v2rayN/ServiceLib/Common/Utils.cs | 2 +- v2rayN/ServiceLib/GlobalUsings.cs | 6 ++---- v2rayN/ServiceLib/Handler/LazyConfig.cs | 2 +- v2rayN/ServiceLib/Handler/UpdateHandler.cs | 2 +- v2rayN/v2rayN/App.xaml | 2 +- v2rayN/v2rayN/GlobalUsings.cs | 2 +- v2rayN/v2rayN/Views/ClashConnectionsView.xaml | 6 +++--- v2rayN/v2rayN/Views/ClashProxiesView.xaml | 8 ++++---- v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml | 8 ++++---- v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml | 8 ++++---- v2rayN/v2rayN/Views/SubEditWindow.xaml.cs | 1 - v2rayN/v2rayN/v2rayN.csproj | 3 +-- 12 files changed, 23 insertions(+), 27 deletions(-) diff --git a/v2rayN/ServiceLib/Common/Utils.cs b/v2rayN/ServiceLib/Common/Utils.cs index 2204cd21..1f90e0cb 100644 --- a/v2rayN/ServiceLib/Common/Utils.cs +++ b/v2rayN/ServiceLib/Common/Utils.cs @@ -366,7 +366,7 @@ namespace ServiceLib.Common public static bool IsBase64String(string plainText) { - if(plainText.IsNullOrEmpty()) return false; + if (plainText.IsNullOrEmpty()) return false; var buffer = new Span(new byte[plainText.Length]); return Convert.TryFromBase64String(plainText, buffer, out int _); } diff --git a/v2rayN/ServiceLib/GlobalUsings.cs b/v2rayN/ServiceLib/GlobalUsings.cs index ae515d50..834ccd5c 100644 --- a/v2rayN/ServiceLib/GlobalUsings.cs +++ b/v2rayN/ServiceLib/GlobalUsings.cs @@ -1,11 +1,9 @@ -global using ServiceLib; -global using ServiceLib.Base; +global using ServiceLib.Base; global using ServiceLib.Common; +global using ServiceLib.Enums; global using ServiceLib.Handler; global using ServiceLib.Handler.CoreConfig; global using ServiceLib.Handler.Fmt; global using ServiceLib.Handler.Statistics; -global using ServiceLib.Enums; global using ServiceLib.Models; -global using ServiceLib.ViewModels; global using ServiceLib.Resx; \ No newline at end of file diff --git a/v2rayN/ServiceLib/Handler/LazyConfig.cs b/v2rayN/ServiceLib/Handler/LazyConfig.cs index 7914679b..0902642d 100644 --- a/v2rayN/ServiceLib/Handler/LazyConfig.cs +++ b/v2rayN/ServiceLib/Handler/LazyConfig.cs @@ -58,7 +58,7 @@ namespace ServiceLib.Handler { _processJob ??= new(); _processJob?.AddProcess(processHandle); - } + } } #endregion Config diff --git a/v2rayN/ServiceLib/Handler/UpdateHandler.cs b/v2rayN/ServiceLib/Handler/UpdateHandler.cs index 73492c30..2a459daf 100644 --- a/v2rayN/ServiceLib/Handler/UpdateHandler.cs +++ b/v2rayN/ServiceLib/Handler/UpdateHandler.cs @@ -40,7 +40,7 @@ namespace ServiceLib.Handler _updateFunc(false, ResUI.MsgDownloadV2rayCoreSuccessfully); string fileName = Utils.GetTempPath(Utils.GetDownloadFileName(url)); fileName = Utils.UrlEncode(fileName); - _updateFunc(true, fileName); + _updateFunc(true, fileName); } else { diff --git a/v2rayN/v2rayN/App.xaml b/v2rayN/v2rayN/App.xaml index 04a602cb..3b7aefee 100644 --- a/v2rayN/v2rayN/App.xaml +++ b/v2rayN/v2rayN/App.xaml @@ -1,9 +1,9 @@  diff --git a/v2rayN/v2rayN/GlobalUsings.cs b/v2rayN/v2rayN/GlobalUsings.cs index a049b0ab..bc789ab0 100644 --- a/v2rayN/v2rayN/GlobalUsings.cs +++ b/v2rayN/v2rayN/GlobalUsings.cs @@ -5,4 +5,4 @@ global using ServiceLib.Enums; global using ServiceLib.Handler; global using ServiceLib.Models; global using ServiceLib.Resx; -global using ServiceLib.ViewModels; +global using ServiceLib.ViewModels; \ No newline at end of file diff --git a/v2rayN/v2rayN/Views/ClashConnectionsView.xaml b/v2rayN/v2rayN/Views/ClashConnectionsView.xaml index 8aa7d97c..4a000135 100644 --- a/v2rayN/v2rayN/Views/ClashConnectionsView.xaml +++ b/v2rayN/v2rayN/Views/ClashConnectionsView.xaml @@ -1,11 +1,11 @@ - - +