Skip to content

Commit

Permalink
Code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Oct 24, 2024
1 parent 34f5c0f commit 871cb81
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 29 deletions.
3 changes: 1 addition & 2 deletions v2rayN/PacLib/PacHandler.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/Handler/Fmt/TrojanFmt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class TrojanFmt : BaseFmt
{
ConfigType = EConfigType.Trojan
};

var url = Utils.TryUri(str);
if (url == null) return null;

Expand Down
1 change: 1 addition & 0 deletions v2rayN/ServiceLib/Models/RoutingItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class RoutingItem
{
[PrimaryKey]
public string Id { get; set; }

public string Remarks { get; set; }
public string Url { get; set; }
public string RuleSet { get; set; }
Expand Down
1 change: 1 addition & 0 deletions v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ private async Task Init()
{
SelectedRouting = new();
SelectedServer = new();
RunningServerToolTipText = "-";

if (_config.TunModeItem.EnableTun && AppHandler.Instance.IsAdministrator)
{
Expand Down
5 changes: 3 additions & 2 deletions v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private void menuSettingsSetUWP_Click(object? sender, RoutedEventArgs e)
public async Task ScanScreenTaskAsync()
{
//ShowHideWindow(false);

NoticeHandler.Instance.SendMessageAndEnqueue("Not yet implemented.(还未实现)");
return;
//if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
Expand All @@ -332,9 +332,10 @@ public async Task ScanScreenTaskAsync()

//ShowHideWindow(true);
}

private async Task ScanImageTaskAsync()
{
var fileName = await UI.OpenFileDialog(this,null );
var fileName = await UI.OpenFileDialog(this, null);
if (fileName.IsNullOrEmpty())
{
return;
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
1 change: 0 additions & 1 deletion v2rayN/v2rayN/Common/QRCodeHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections;
using System.Drawing;
using System.IO;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
Expand Down
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
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void btnSave_Click(object sender, RoutedEventArgs e)
{
_config.GlobalHotkeys = _TextBoxKeyEventItem.Values.ToList();

if ( ConfigHandler.SaveConfig(_config).Result == 0)
if (ConfigHandler.SaveConfig(_config).Result == 0)
{
HotkeyHandler.Instance.ReLoad();
this.DialogResult = true;
Expand Down
1 change: 0 additions & 1 deletion v2rayN/v2rayN/Views/OptionSettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,6 @@
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
TextWrapping="Wrap" />

</Grid>
</ScrollViewer>
</TabItem>
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/RoutingSettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public RoutingSettingWindow()
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
});
WindowsUtils.SetDarkBorder(this, AppHandler.Instance.Config.UiItem.FollowSystemTheme ? !WindowsUtils.IsLightTheme() : AppHandler.Instance.Config.UiItem.ColorModeDark);

}

private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
Expand Down
8 changes: 4 additions & 4 deletions v2rayN/v2rayN/Views/SubEditWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<reactiveui:ReactiveWindow
x:Class="v2rayN.Views.SubEditWindow"
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.menuSubSetting}"
Width="700"
Height="600"
Expand Down

0 comments on commit 871cb81

Please sign in to comment.