From 38b2a7d2ca1da517c70da1c863fb29ba0287af91 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Fri, 31 Oct 2025 17:50:28 +0800 Subject: [PATCH] Rename QRCodeWindowsUtils --- .../v2rayN/Common/{QRCodeUtils.cs => QRCodeWindowsUtils.cs} | 6 +++--- v2rayN/v2rayN/GlobalUsings.cs | 1 + v2rayN/v2rayN/Views/MainWindow.xaml.cs | 2 +- v2rayN/v2rayN/Views/ProfilesView.xaml.cs | 2 +- v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) rename v2rayN/v2rayN/Common/{QRCodeUtils.cs => QRCodeWindowsUtils.cs} (93%) diff --git a/v2rayN/v2rayN/Common/QRCodeUtils.cs b/v2rayN/v2rayN/Common/QRCodeWindowsUtils.cs similarity index 93% rename from v2rayN/v2rayN/Common/QRCodeUtils.cs rename to v2rayN/v2rayN/Common/QRCodeWindowsUtils.cs index 6b0bc38d..9e001a1d 100644 --- a/v2rayN/v2rayN/Common/QRCodeUtils.cs +++ b/v2rayN/v2rayN/Common/QRCodeWindowsUtils.cs @@ -2,9 +2,9 @@ using System.Drawing; using System.Windows.Media; using System.Windows.Media.Imaging; -namespace v2rayN; +namespace v2rayN.Common; -public class QRCodeUtils +public class QRCodeWindowsUtils { public static ImageSource? GetQRCode(string? strContent) { @@ -14,7 +14,7 @@ public class QRCodeUtils } try { - var qrCodeImage = ServiceLib.Common.QRCodeUtils.GenQRCode(strContent); + var qrCodeImage = QRCodeUtils.GenQRCode(strContent); return qrCodeImage is null ? null : ByteToImage(qrCodeImage); } catch (Exception ex) diff --git a/v2rayN/v2rayN/GlobalUsings.cs b/v2rayN/v2rayN/GlobalUsings.cs index a8fa461d..1f2d1936 100644 --- a/v2rayN/v2rayN/GlobalUsings.cs +++ b/v2rayN/v2rayN/GlobalUsings.cs @@ -31,3 +31,4 @@ global using ServiceLib.Manager; global using ServiceLib.Models; global using ServiceLib.Resx; global using ServiceLib.ViewModels; +global using v2rayN.Common; diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index 9dc818ee..a9114813 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -328,7 +328,7 @@ public partial class MainWindow if (Application.Current?.MainWindow is Window window) { - var bytes = QRCodeUtils.CaptureScreen(window); + var bytes = QRCodeWindowsUtils.CaptureScreen(window); await ViewModel?.ScanScreenResult(bytes); } diff --git a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs index 79d4cdb9..ac79a8c8 100644 --- a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs +++ b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs @@ -170,7 +170,7 @@ public partial class ProfilesView public async void ShareServer(string url) { - var img = QRCodeUtils.GetQRCode(url); + var img = QRCodeWindowsUtils.GetQRCode(url); var dialog = new QrcodeView() { imgQrcode = { Source = img }, diff --git a/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs index f44739d3..14b3aa38 100644 --- a/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs @@ -64,7 +64,7 @@ public partial class SubSettingWindow { return; } - var img = QRCodeUtils.GetQRCode(url); + var img = QRCodeWindowsUtils.GetQRCode(url); var dialog = new QrcodeView() { imgQrcode = { Source = img },