Skip to content

Commit

Permalink
Code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Aug 20, 2024
1 parent 8d1d10b commit a6f27e5
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/Common/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public static string GetPunycode(string url)

public static bool IsBase64String(string plainText)
{
if(plainText.IsNullOrEmpty()) return false;
if (plainText.IsNullOrEmpty()) return false;
var buffer = new Span<byte>(new byte[plainText.Length]);
return Convert.TryFromBase64String(plainText, buffer, out int _);
}
Expand Down
6 changes: 2 additions & 4 deletions v2rayN/ServiceLib/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/Handler/LazyConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void AddProcess(IntPtr processHandle)
{
_processJob ??= new();
_processJob?.AddProcess(processHandle);
}
}
}

#endregion Config
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/Handler/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void CheckUpdateGuiN(Config config, Action<bool, string> update, bool pre
_updateFunc(false, ResUI.MsgDownloadV2rayCoreSuccessfully);
string fileName = Utils.GetTempPath(Utils.GetDownloadFileName(url));
fileName = Utils.UrlEncode(fileName);
_updateFunc(true, fileName);
_updateFunc(true, fileName);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/App.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Application
x:Class="v2rayN.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
ShutdownMode="OnExplicitShutdown"
StartupUri="Views/MainWindow.xaml">
<Application.Resources>
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
global using ServiceLib.Handler;
global using ServiceLib.Models;
global using ServiceLib.Resx;
global using ServiceLib.ViewModels;
global using ServiceLib.ViewModels;
6 changes: 3 additions & 3 deletions v2rayN/v2rayN/Views/ClashConnectionsView.xaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<reactiveui:ReactiveUserControl
x:Class="v2rayN.Views.ClashConnectionsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
d:DesignHeight="450"
Expand Down
8 changes: 4 additions & 4 deletions v2rayN/v2rayN/Views/ClashProxiesView.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<reactiveui:ReactiveUserControl
x:Class="v2rayN.Views.ClashProxiesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
xmlns:converters="clr-namespace:v2rayN.Converters"
d:DesignHeight="450"
d:DesignWidth="800"
x:TypeArguments="vms:ClashProxiesViewModel"
Expand Down
8 changes: 4 additions & 4 deletions v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<reactiveui:ReactiveWindow
x:Class="v2rayN.Views.RoutingRuleDetailsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
xmlns:conv="clr-namespace:v2rayN.Converters"
Title="{x:Static resx:ResUI.menuRoutingRuleDetailsSetting}"
Width="900"
Height="700"
Expand Down
8 changes: 4 additions & 4 deletions v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<reactiveui:ReactiveWindow
x:Class="v2rayN.Views.RoutingRuleSettingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
xmlns:conv="clr-namespace:v2rayN.Converters"
Title="{x:Static resx:ResUI.menuRoutingRuleSetting}"
Width="960"
Height="700"
Expand Down
1 change: 0 additions & 1 deletion v2rayN/v2rayN/Views/SubEditWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ private bool UpdateViewHandler(EViewAction action, object? obj)
case EViewAction.CloseWindow:
this.DialogResult = true;
break;

}
return true;
}
Expand Down
3 changes: 1 addition & 2 deletions v2rayN/v2rayN/v2rayN.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
<PackageReference Include="QRCoder.Xaml" Version="1.6.0" />
<PackageReference Include="TaskScheduler" Version="2.11.0" />
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageReference Include="ReactiveUI.Validation" Version="4.0.9" />
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageReference Include="ReactiveUI.WPF" Version="20.1.1" />
</ItemGroup>

Expand Down

0 comments on commit a6f27e5

Please sign in to comment.