Skip to content

Commit 386c86b

Browse files
committed
Code clean
1 parent 925cf16 commit 386c86b

File tree

9 files changed

+50
-56
lines changed

9 files changed

+50
-56
lines changed

v2rayN/ServiceLib/Handler/ConfigHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,7 @@ public static async Task RemoveRoutingItem(RoutingItem routingItem)
21062106
public static async Task<int> InitBuiltinDNS(Config config)
21072107
{
21082108
var items = await AppHandler.Instance.DNSItems();
2109-
2109+
21102110
// Check existing DNS items and disable those with empty NormalDNS
21112111
var needsUpdate = false;
21122112
foreach (var existingItem in items)
@@ -2117,13 +2117,13 @@ public static async Task<int> InitBuiltinDNS(Config config)
21172117
needsUpdate = true;
21182118
}
21192119
}
2120-
2120+
21212121
// Update items if any changes were made
21222122
if (needsUpdate)
21232123
{
21242124
await SQLiteHelper.Instance.UpdateAllAsync(items);
21252125
}
2126-
2126+
21272127
if (items.Count <= 0)
21282128
{
21292129
var item = new DNSItem()

v2rayN/ServiceLib/Handler/Fmt/AnytlsFmt.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using static QRCoder.PayloadGenerator;
2-
31
namespace ServiceLib.Handler.Fmt;
2+
43
public class AnytlsFmt : BaseFmt
54
{
65
public static ProfileItem? Resolve(string str, out string msg)

v2rayN/ServiceLib/Models/SingboxConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,13 @@ public class Server4Sbox : BaseServer4Sbox
240240
public int? server_port { get; set; }
241241
public string? path { get; set; }
242242
public Headers4Sbox? headers { get; set; }
243+
243244
// public List<string>? path { get; set; } // hosts
244245
public Dictionary<string, List<string>>? predefined { get; set; }
246+
245247
// Deprecated
246248
public string? address { get; set; }
249+
247250
public string? address_resolver { get; set; }
248251
public string? address_strategy { get; set; }
249252
public string? strategy { get; set; }

v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
using System.Collections.Generic;
21
using System.Data;
32
using System.Net;
43
using System.Net.NetworkInformation;
5-
using System.Reactive;
6-
using System.Text;
7-
using DynamicData;
8-
using ServiceLib.Models;
94

105
namespace ServiceLib.Services.CoreConfig;
116

v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<TabItem Header="{x:Static resx:ResUI.ThBasicDNSSettings}">
4040
<ScrollViewer VerticalScrollBarVisibility="Visible">
4141
<Grid
42-
Margin="{StaticResource Margin4}"
42+
Margin="{StaticResource Margin8}"
4343
ColumnDefinitions="Auto,Auto,*"
4444
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
4545

@@ -50,7 +50,7 @@
5050
Margin="{StaticResource Margin4}"
5151
VerticalAlignment="Center"
5252
Text="{x:Static resx:ResUI.TbCustomDNSEnabledPageInvalid}" />
53-
53+
5454
<TextBlock
5555
Grid.Row="1"
5656
Grid.Column="0"
@@ -186,7 +186,7 @@
186186
<TabItem Header="{x:Static resx:ResUI.ThAdvancedDNSSettings}">
187187
<ScrollViewer VerticalScrollBarVisibility="Visible">
188188
<Grid
189-
Margin="{StaticResource Margin4}"
189+
Margin="{StaticResource Margin8}"
190190
ColumnDefinitions="Auto,Auto,*"
191191
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,*">
192192

@@ -284,21 +284,22 @@
284284
Grid.ColumnSpan="3"
285285
Margin="{StaticResource Margin4}"
286286
VerticalAlignment="Stretch"
287-
Watermark="{x:Static resx:ResUI.TbDNSHostsConfig}"
288287
BorderThickness="1"
289288
Classes="TextArea"
290-
TextWrapping="Wrap" />
289+
TextWrapping="Wrap"
290+
Watermark="{x:Static resx:ResUI.TbDNSHostsConfig}" />
291291
</Grid>
292292
</ScrollViewer>
293293
</TabItem>
294+
294295
<TabItem Header="{x:Static resx:ResUI.TbSettingsCoreDns}">
295296
<DockPanel Margin="{StaticResource Margin8}">
296297
<Grid DockPanel.Dock="Top">
297298
<Grid.RowDefinitions>
298299
<RowDefinition Height="Auto" />
299300
<RowDefinition Height="Auto" />
300301
</Grid.RowDefinitions>
301-
302+
302303
<StackPanel Grid.Row="0" Orientation="Horizontal">
303304
<TextBlock
304305
Margin="{StaticResource Margin4}"
@@ -309,7 +310,7 @@
309310
Margin="{StaticResource Margin4}"
310311
HorizontalAlignment="Left" />
311312
</StackPanel>
312-
313+
313314
<StackPanel Grid.Row="1" Orientation="Horizontal">
314315
<TextBlock
315316
Margin="{StaticResource Margin4}"
@@ -387,7 +388,7 @@
387388
<RowDefinition Height="Auto" />
388389
<RowDefinition Height="Auto" />
389390
</Grid.RowDefinitions>
390-
391+
391392
<StackPanel Grid.Row="0" Orientation="Horizontal">
392393
<TextBlock
393394
Margin="{StaticResource Margin4}"
@@ -398,7 +399,7 @@
398399
Margin="{StaticResource Margin4}"
399400
HorizontalAlignment="Left" />
400401
</StackPanel>
401-
402+
402403
<StackPanel Grid.Row="1" Orientation="Horizontal">
403404
<TextBlock Margin="{StaticResource Margin4}" VerticalAlignment="Center">
404405
<HyperlinkButton Classes="WithIcon" Click="linkDnsSingboxObjectDoc_Click">

v2rayN/v2rayN/Views/ClashConnectionsView.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<reactiveui:ReactiveUserControl
22
x:Class="v2rayN.Views.ClashConnectionsView"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4-
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
5-
xmlns:reactiveui="http://reactiveui.net"
6-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
74
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
87
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:reactiveui="http://reactiveui.net"
99
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
1010
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
1111
d:DesignHeight="450"

v2rayN/v2rayN/Views/ClashProxiesView.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<reactiveui:ReactiveUserControl
22
x:Class="v2rayN.Views.ClashProxiesView"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4-
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
5-
xmlns:reactiveui="http://reactiveui.net"
6-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
74
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:converters="clr-namespace:v2rayN.Converters"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
88
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
xmlns:reactiveui="http://reactiveui.net"
910
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
1011
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
11-
xmlns:converters="clr-namespace:v2rayN.Converters"
1212
d:DesignHeight="450"
1313
d:DesignWidth="800"
1414
x:TypeArguments="vms:ClashProxiesViewModel"

v2rayN/v2rayN/Views/DNSSettingWindow.xaml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
Grid.Row="1"
8484
Grid.Column="1"
8585
Width="200"
86-
IsEditable="True"
8786
Margin="{StaticResource Margin8}"
87+
IsEditable="True"
8888
Style="{StaticResource DefComboBox}" />
8989

9090
<TextBlock
@@ -99,8 +99,8 @@
9999
Grid.Row="2"
100100
Grid.Column="1"
101101
Width="200"
102-
IsEditable="True"
103102
Margin="{StaticResource Margin8}"
103+
IsEditable="True"
104104
Style="{StaticResource DefComboBox}" />
105105

106106
<TextBlock
@@ -115,8 +115,8 @@
115115
Grid.Row="3"
116116
Grid.Column="1"
117117
Width="200"
118-
IsEditable="True"
119118
Margin="{StaticResource Margin8}"
119+
IsEditable="True"
120120
Style="{StaticResource DefComboBox}" />
121121
<TextBlock
122122
Grid.Row="3"
@@ -138,8 +138,8 @@
138138
Grid.Row="4"
139139
Grid.Column="1"
140140
Width="200"
141-
IsEditable="True"
142141
Margin="{StaticResource Margin8}"
142+
IsEditable="True"
143143
Style="{StaticResource DefComboBox}" />
144144
<TextBlock
145145
Grid.Row="4"
@@ -304,7 +304,6 @@
304304
Style="{StaticResource ToolbarTextBlock}"
305305
Text="{x:Static resx:ResUI.TbPreventDNSLeaks}" />
306306

307-
308307
<TextBlock
309308
Grid.Row="4"
310309
Grid.Column="0"
@@ -317,8 +316,8 @@
317316
Grid.Row="4"
318317
Grid.Column="1"
319318
Width="200"
320-
IsEditable="True"
321319
Margin="{StaticResource Margin8}"
320+
IsEditable="True"
322321
Style="{StaticResource DefComboBox}" />
323322
<TextBlock
324323
Grid.Row="4"
@@ -360,19 +359,19 @@
360359
<RowDefinition Height="Auto" />
361360
<RowDefinition Height="Auto" />
362361
</Grid.RowDefinitions>
363-
362+
364363
<StackPanel Grid.Row="0" Orientation="Horizontal">
365364
<TextBlock
366-
Margin="{StaticResource Margin8}"
367-
VerticalAlignment="Center"
368-
Style="{StaticResource ToolbarTextBlock}"
369-
Text="{x:Static resx:ResUI.TbCustomDNSEnable}" />
365+
Margin="{StaticResource Margin8}"
366+
VerticalAlignment="Center"
367+
Style="{StaticResource ToolbarTextBlock}"
368+
Text="{x:Static resx:ResUI.TbCustomDNSEnable}" />
370369
<ToggleButton
371-
x:Name="togRayCustomDNSEnableCompatible"
372-
Margin="{StaticResource Margin8}"
373-
HorizontalAlignment="Left" />
370+
x:Name="togRayCustomDNSEnableCompatible"
371+
Margin="{StaticResource Margin8}"
372+
HorizontalAlignment="Left" />
374373
</StackPanel>
375-
374+
376375
<StackPanel Grid.Row="1" Orientation="Horizontal">
377376
<TextBlock
378377
Margin="{StaticResource Margin8}"
@@ -458,19 +457,19 @@
458457
<RowDefinition Height="Auto" />
459458
<RowDefinition Height="Auto" />
460459
</Grid.RowDefinitions>
461-
460+
462461
<StackPanel Grid.Row="0" Orientation="Horizontal">
463462
<TextBlock
464-
Margin="{StaticResource Margin8}"
465-
VerticalAlignment="Center"
466-
Style="{StaticResource ToolbarTextBlock}"
467-
Text="{x:Static resx:ResUI.TbCustomDNSEnable}" />
463+
Margin="{StaticResource Margin8}"
464+
VerticalAlignment="Center"
465+
Style="{StaticResource ToolbarTextBlock}"
466+
Text="{x:Static resx:ResUI.TbCustomDNSEnable}" />
468467
<ToggleButton
469-
x:Name="togSBCustomDNSEnableCompatible"
470-
Margin="{StaticResource Margin8}"
471-
HorizontalAlignment="Left" />
468+
x:Name="togSBCustomDNSEnableCompatible"
469+
Margin="{StaticResource Margin8}"
470+
HorizontalAlignment="Left" />
472471
</StackPanel>
473-
472+
474473
<StackPanel Grid.Row="1" Orientation="Horizontal">
475474
<TextBlock
476475
Margin="{StaticResource Margin8}"

v2rayN/v2rayN/Views/StatusBarView.xaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@
9292
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
9393
DisplayMemberPath="Remarks"
9494
FontSize="{DynamicResource StdFontSize}"
95-
Style="{StaticResource MaterialDesignFloatingHintComboBox}">
96-
</ComboBox>
95+
Style="{StaticResource MaterialDesignFloatingHintComboBox}" />
9796
</StackPanel>
9897

9998
<StackPanel Margin="{StaticResource MarginLeftRight8}" VerticalAlignment="Center">
@@ -185,8 +184,7 @@
185184
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
186185
DisplayMemberPath="Remarks"
187186
FontSize="{DynamicResource StdFontSize}"
188-
Style="{StaticResource MaterialDesignFilledComboBox}">
189-
</ComboBox>
187+
Style="{StaticResource MaterialDesignFilledComboBox}" />
190188
</DockPanel>
191189
</MenuItem.Header>
192190
</MenuItem>
@@ -200,8 +198,7 @@
200198
AutomationProperties.Name="{x:Static resx:ResUI.menuServers}"
201199
DisplayMemberPath="Text"
202200
FontSize="{DynamicResource StdFontSize}"
203-
Style="{StaticResource MaterialDesignFilledComboBox}">
204-
</ComboBox>
201+
Style="{StaticResource MaterialDesignFilledComboBox}" />
205202
</DockPanel>
206203
</MenuItem.Header>
207204
</MenuItem>

0 commit comments

Comments
 (0)