From c9c1cd8cbb59328903262e58d9ff4878d280e265 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 17 Aug 2025 16:26:13 +0800 Subject: [PATCH] Add Helper folder --- v2rayN/ServiceLib/Common/{QRCodeHelper.cs => QRCodeUtils.cs} | 2 +- v2rayN/ServiceLib/GlobalUsings.cs | 5 +++-- v2rayN/ServiceLib/{Common => Helper}/DownloaderHelper.cs | 2 +- v2rayN/ServiceLib/{Common => Helper}/HttpClientHelper.cs | 2 +- v2rayN/ServiceLib/{Common => Helper}/SqliteHelper.cs | 2 +- v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs | 4 ++-- v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs | 2 +- v2rayN/v2rayN/Common/QRCodeHelper.cs | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) rename v2rayN/ServiceLib/Common/{QRCodeHelper.cs => QRCodeUtils.cs} (98%) rename v2rayN/ServiceLib/{Common => Helper}/DownloaderHelper.cs (99%) rename v2rayN/ServiceLib/{Common => Helper}/HttpClientHelper.cs (99%) rename v2rayN/ServiceLib/{Common => Helper}/SqliteHelper.cs (98%) diff --git a/v2rayN/ServiceLib/Common/QRCodeHelper.cs b/v2rayN/ServiceLib/Common/QRCodeUtils.cs similarity index 98% rename from v2rayN/ServiceLib/Common/QRCodeHelper.cs rename to v2rayN/ServiceLib/Common/QRCodeUtils.cs index 9938eadd..3d3dc90b 100644 --- a/v2rayN/ServiceLib/Common/QRCodeHelper.cs +++ b/v2rayN/ServiceLib/Common/QRCodeUtils.cs @@ -4,7 +4,7 @@ using ZXing.SkiaSharp; namespace ServiceLib.Common; -public class QRCodeHelper +public class QRCodeUtils { public static byte[]? GenQRCode(string? url) { diff --git a/v2rayN/ServiceLib/GlobalUsings.cs b/v2rayN/ServiceLib/GlobalUsings.cs index a4bf3ccd..7feb4705 100644 --- a/v2rayN/ServiceLib/GlobalUsings.cs +++ b/v2rayN/ServiceLib/GlobalUsings.cs @@ -1,11 +1,12 @@ -global using ServiceLib.Base; +global using ServiceLib.Base; global using ServiceLib.Common; global using ServiceLib.Enums; global using ServiceLib.Handler; +global using ServiceLib.Helper; global using ServiceLib.Handler.Fmt; global using ServiceLib.Services; global using ServiceLib.Services.Statistics; global using ServiceLib.Services.CoreConfig; global using ServiceLib.Models; global using ServiceLib.Resx; -global using ServiceLib.Handler.SysProxy; \ No newline at end of file +global using ServiceLib.Handler.SysProxy; diff --git a/v2rayN/ServiceLib/Common/DownloaderHelper.cs b/v2rayN/ServiceLib/Helper/DownloaderHelper.cs similarity index 99% rename from v2rayN/ServiceLib/Common/DownloaderHelper.cs rename to v2rayN/ServiceLib/Helper/DownloaderHelper.cs index 073e1ab4..3764499c 100644 --- a/v2rayN/ServiceLib/Common/DownloaderHelper.cs +++ b/v2rayN/ServiceLib/Helper/DownloaderHelper.cs @@ -1,7 +1,7 @@ using System.Net; using Downloader; -namespace ServiceLib.Common; +namespace ServiceLib.Helper; public class DownloaderHelper { diff --git a/v2rayN/ServiceLib/Common/HttpClientHelper.cs b/v2rayN/ServiceLib/Helper/HttpClientHelper.cs similarity index 99% rename from v2rayN/ServiceLib/Common/HttpClientHelper.cs rename to v2rayN/ServiceLib/Helper/HttpClientHelper.cs index 8bc1384a..3dfb45cc 100644 --- a/v2rayN/ServiceLib/Common/HttpClientHelper.cs +++ b/v2rayN/ServiceLib/Helper/HttpClientHelper.cs @@ -2,7 +2,7 @@ using System.Net.Http.Headers; using System.Net.Mime; using System.Text; -namespace ServiceLib.Common; +namespace ServiceLib.Helper; /// /// diff --git a/v2rayN/ServiceLib/Common/SqliteHelper.cs b/v2rayN/ServiceLib/Helper/SqliteHelper.cs similarity index 98% rename from v2rayN/ServiceLib/Common/SqliteHelper.cs rename to v2rayN/ServiceLib/Helper/SqliteHelper.cs index 62b0a830..1561d3a5 100644 --- a/v2rayN/ServiceLib/Common/SqliteHelper.cs +++ b/v2rayN/ServiceLib/Helper/SqliteHelper.cs @@ -1,7 +1,7 @@ using System.Collections; using SQLite; -namespace ServiceLib.Common; +namespace ServiceLib.Helper; public sealed class SQLiteHelper { diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 8578036d..8945c1eb 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -420,7 +420,7 @@ public class MainWindowViewModel : MyReactiveObject public async Task ScanScreenResult(byte[]? bytes) { - var result = QRCodeHelper.ParseBarcode(bytes); + var result = QRCodeUtils.ParseBarcode(bytes); await AddScanResultAsync(result); } @@ -437,7 +437,7 @@ public class MainWindowViewModel : MyReactiveObject return; } - var result = QRCodeHelper.ParseBarcode(fileName); + var result = QRCodeUtils.ParseBarcode(fileName); await AddScanResultAsync(result); } diff --git a/v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs index c4e3052c..3c498cb6 100644 --- a/v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs @@ -23,7 +23,7 @@ public partial class QrcodeView : UserControl private Bitmap? GetQRCode(string? url) { - var bytes = QRCodeHelper.GenQRCode(url); + var bytes = QRCodeUtils.GenQRCode(url); return ByteToBitmap(bytes); } diff --git a/v2rayN/v2rayN/Common/QRCodeHelper.cs b/v2rayN/v2rayN/Common/QRCodeHelper.cs index 74bf9545..6d070972 100644 --- a/v2rayN/v2rayN/Common/QRCodeHelper.cs +++ b/v2rayN/v2rayN/Common/QRCodeHelper.cs @@ -17,7 +17,7 @@ public class QRCodeHelper } try { - var qrCodeImage = ServiceLib.Common.QRCodeHelper.GenQRCode(strContent); + var qrCodeImage = QRCodeUtils.GenQRCode(strContent); return qrCodeImage is null ? null : ByteToImage(qrCodeImage); } catch