From bf8bbbdcb0c08917c7581f325f8a1bd005f78064 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sat, 7 Dec 2024 16:29:58 +0800 Subject: [PATCH] Code clean --- .../ServiceLib/Services/Statistics/StatisticsSingboxService.cs | 2 +- v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs | 2 +- v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs | 2 +- v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/v2rayN/ServiceLib/Services/Statistics/StatisticsSingboxService.cs b/v2rayN/ServiceLib/Services/Statistics/StatisticsSingboxService.cs index e8f294e4..ef70e3f7 100644 --- a/v2rayN/ServiceLib/Services/Statistics/StatisticsSingboxService.cs +++ b/v2rayN/ServiceLib/Services/Statistics/StatisticsSingboxService.cs @@ -10,7 +10,7 @@ namespace ServiceLib.Services.Statistics private ClientWebSocket? webSocket; private Action? _updateFunc; private string Url => $"ws://{Global.Loopback}:{AppHandler.Instance.StatePort2}/traffic"; - + public StatisticsSingboxService(Config config, Action updateFunc) { _config = config; diff --git a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index e999576f..f66a15c3 100644 --- a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -459,7 +459,7 @@ namespace ServiceLib.ViewModels if (_config.Inbound.First().NewPort4LAN) { StringBuilder sb2 = new(); - sb2.Append($"[{EInboundProtocol.mixed}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks2)}]"); + sb2.Append($"[{EInboundProtocol.mixed}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks2)}]"); InboundLanDisplay = $"{ResUI.LabLAN}:{sb2}"; } else diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index fa214786..9bd228af 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -152,7 +152,7 @@ namespace v2rayN.Desktop.Views menuGlobalHotkeySetting.IsVisible = false; } menuAddServerViaScan.IsVisible = false; - + RestoreUI(); AddHelpMenuItem(); //WindowsHandler.Instance.RegisterGlobalHotkey(_config, OnHotkeyHandler, null); diff --git a/v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs b/v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs index 9de1ceae..acc0cfec 100644 --- a/v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs +++ b/v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs @@ -51,6 +51,7 @@ namespace v2rayN.Views { AutofitColumnWidth(); } + private void AutofitColumnWidth() { foreach (var it in lstConnections.Columns)