From 3187eeef79ef12ea80fc81a618513839d3e398c2 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 4 Oct 2026 11:41:34 +0800 Subject: [PATCH] Code clean --- v2rayN/ServiceLib.Tests/CoreConfig/CoreConfigTestFactory.cs | 5 ----- .../CoreConfig/Singbox/CoreConfigSingboxServiceTests.cs | 1 - .../CoreConfig/V2ray/CoreConfigV2rayServiceTests.cs | 2 +- v2rayN/ServiceLib.UdpTest/Tester/McBeService.cs | 4 ++-- v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 2 +- v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs | 2 -- v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs | 1 + v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml.cs | 1 + 8 files changed, 6 insertions(+), 12 deletions(-) diff --git a/v2rayN/ServiceLib.Tests/CoreConfig/CoreConfigTestFactory.cs b/v2rayN/ServiceLib.Tests/CoreConfig/CoreConfigTestFactory.cs index 53c5f4f1..5c9e389f 100644 --- a/v2rayN/ServiceLib.Tests/CoreConfig/CoreConfigTestFactory.cs +++ b/v2rayN/ServiceLib.Tests/CoreConfig/CoreConfigTestFactory.cs @@ -1,8 +1,3 @@ -using System.Reflection; -using ServiceLib.Enums; -using ServiceLib.Manager; -using ServiceLib.Models; - namespace ServiceLib.Tests.CoreConfig; internal static class CoreConfigTestFactory diff --git a/v2rayN/ServiceLib.Tests/CoreConfig/Singbox/CoreConfigSingboxServiceTests.cs b/v2rayN/ServiceLib.Tests/CoreConfig/Singbox/CoreConfigSingboxServiceTests.cs index a0825357..5f081a39 100644 --- a/v2rayN/ServiceLib.Tests/CoreConfig/Singbox/CoreConfigSingboxServiceTests.cs +++ b/v2rayN/ServiceLib.Tests/CoreConfig/Singbox/CoreConfigSingboxServiceTests.cs @@ -716,7 +716,6 @@ public class CoreConfigSingboxServiceTests } } - [Test] public async Task GenerateClientConfigContent_CustomOutbound_ShouldReplaceWithUserCustomOutboundJson() { diff --git a/v2rayN/ServiceLib.Tests/CoreConfig/V2ray/CoreConfigV2rayServiceTests.cs b/v2rayN/ServiceLib.Tests/CoreConfig/V2ray/CoreConfigV2rayServiceTests.cs index 0a512e17..e352d0c5 100644 --- a/v2rayN/ServiceLib.Tests/CoreConfig/V2ray/CoreConfigV2rayServiceTests.cs +++ b/v2rayN/ServiceLib.Tests/CoreConfig/V2ray/CoreConfigV2rayServiceTests.cs @@ -51,7 +51,7 @@ public class CoreConfigV2rayServiceTests .Select(item => item!.GetValue()) .Should().BeEquivalentTo(["a=1", "b=2"]); } - + [Test] public async Task GenerateClientConfigContent_PolicyGroup_ShouldExpandChildrenAndBuildBalancer() { diff --git a/v2rayN/ServiceLib.UdpTest/Tester/McBeService.cs b/v2rayN/ServiceLib.UdpTest/Tester/McBeService.cs index 4efcaae9..6452b374 100644 --- a/v2rayN/ServiceLib.UdpTest/Tester/McBeService.cs +++ b/v2rayN/ServiceLib.UdpTest/Tester/McBeService.cs @@ -43,9 +43,9 @@ public class McBeService : IUdpTest { // 0x1c | client alive time in ms (recorded from previous ping) | // server GUID | Magic | string length | Edition - // + // // Edition Example: - // + // // MCPE;Dedicated Server;527;1.19.1;0;10;13253860892328930865;Bedrock level;Survival;1;19132;19133; if (mcbeResponseBytes.Length < 48) { diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index f86d2a3c..08a139bb 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -941,7 +941,7 @@ namespace ServiceLib.Resx { return ResourceManager.GetString("menuCheckAndUpdate", resourceCulture); } } - + /// /// 查找类似 Only Check 的本地化字符串。 /// diff --git a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs index 4a853a7f..d7805232 100644 --- a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs @@ -148,7 +148,6 @@ public partial class AddServerWindow : WindowBase this.Bind(ViewModel, vm => vm.MasquePath, v => v.txtPath14.Text).DisposeWith(currentTypeDisposables); this.Bind(ViewModel, vm => vm.MasqueHeaders, v => v.txtHttpHeaders14.Text).DisposeWith(currentTypeDisposables); break; - } }) .DisposeWith(disposables); @@ -202,7 +201,6 @@ public partial class AddServerWindow : WindowBase this.BindCommand(ViewModel, vm => vm.FetchCertChainCmd, v => v.btnFetchCertChain).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); }); - } private void InitializeData(ProfileItem profileItem) diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs index 2e09404a..43ccba14 100644 --- a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs @@ -439,6 +439,7 @@ public partial class ProfilesView : ReactiveUserControl private static readonly DataFormat LstProfilesRowFormat = DataFormat.CreateInProcessFormat("LstProfilesRow"); + private (Point, PointerPressedEventArgs)? _dragStartPoint; private void LstProfiles_PointerPressed(object? sender, PointerPressedEventArgs e) diff --git a/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml.cs b/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml.cs index 8d4fb1db..d5ce1a39 100644 --- a/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml.cs @@ -149,5 +149,6 @@ public partial class ProfilesSelectWindow e.Handled = true; } } + #endregion Event }