mirror of
https://github.com/2dust/v2rayN.git
synced 2025-07-02 04:52:09 +00:00
Code clean
This commit is contained in:
parent
81efd25e0a
commit
12be8bda52
14 changed files with 28 additions and 30 deletions
|
@ -1,9 +1,9 @@
|
||||||
<Application
|
<Application
|
||||||
x:Class="v2rayN.App"
|
x:Class="v2rayN.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
||||||
ShutdownMode="OnExplicitShutdown"
|
ShutdownMode="OnExplicitShutdown"
|
||||||
StartupUri="Views/MainWindow.xaml">
|
StartupUri="Views/MainWindow.xaml">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
|
|
@ -205,7 +205,6 @@ namespace v2rayN.Handler
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LazyConfig.Instance.SetConfig(config);
|
LazyConfig.Instance.SetConfig(config);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,6 @@ namespace v2rayN.Handler
|
||||||
Utils.SaveLog("Tun mode restart the core once");
|
Utils.SaveLog("Tun mode restart the core once");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,8 +256,8 @@ namespace v2rayN.Handler
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
public const int RAS_MaxEntryName = 256;
|
public const int RAS_MaxEntryName = 256;
|
||||||
public const int MAX_PATH = 260; // Standard MAX_PATH value in Windows
|
|
||||||
|
|
||||||
|
public const int MAX_PATH = 260; // Standard MAX_PATH value in Windows
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion WinInet structures
|
#endregion WinInet structures
|
||||||
|
@ -310,6 +310,7 @@ namespace v2rayN.Handler
|
||||||
[DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
[DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
public static extern bool InternetSetOption(IntPtr hInternet, InternetOption dwOption, IntPtr lpBuffer, int dwBufferLength);
|
public static extern bool InternetSetOption(IntPtr hInternet, InternetOption dwOption, IntPtr lpBuffer, int dwBufferLength);
|
||||||
|
|
||||||
[DllImport("Rasapi32.dll", CharSet = CharSet.Auto)]
|
[DllImport("Rasapi32.dll", CharSet = CharSet.Auto)]
|
||||||
public static extern uint RasEnumEntries(
|
public static extern uint RasEnumEntries(
|
||||||
string? reserved, // Reserved, must be null
|
string? reserved, // Reserved, must be null
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
using PacLib;
|
using PacLib;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
using v2rayN.Properties;
|
|
||||||
using v2rayN.Tool;
|
|
||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
|
@ -33,7 +28,6 @@ namespace v2rayN.Handler
|
||||||
|
|
||||||
static SysProxyHandle()
|
static SysProxyHandle()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool UpdateSysProxy(Config config, bool forceDisable)
|
public static bool UpdateSysProxy(Config config, bool forceDisable)
|
||||||
|
|
|
@ -148,11 +148,14 @@ namespace v2rayN.ViewModels
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateNCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateNCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateV2flyCoreCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateV2flyCoreCmd { get; }
|
||||||
|
|
||||||
//public ReactiveCommand<Unit, Unit> CheckUpdateSagerNetCoreCmd { get; }
|
//public ReactiveCommand<Unit, Unit> CheckUpdateSagerNetCoreCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateXrayCoreCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateXrayCoreCmd { get; }
|
||||||
|
|
||||||
//public ReactiveCommand<Unit, Unit> CheckUpdateClashCoreCmd { get; }
|
//public ReactiveCommand<Unit, Unit> CheckUpdateClashCoreCmd { get; }
|
||||||
//public ReactiveCommand<Unit, Unit> CheckUpdateClashMetaCoreCmd { get; }
|
//public ReactiveCommand<Unit, Unit> CheckUpdateClashMetaCoreCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateSingBoxCoreCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateSingBoxCoreCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateGeoCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateGeoCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
|
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<reactiveui:ReactiveWindow
|
<reactiveui:ReactiveWindow
|
||||||
x:Class="v2rayN.Views.AddServerWindow"
|
x:Class="v2rayN.Views.AddServerWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:reactiveui="http://reactiveui.net"
|
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:conv="clr-namespace:v2rayN.Converters"
|
||||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||||
Title="{x:Static resx:ResUI.menuServers}"
|
Title="{x:Static resx:ResUI.menuServers}"
|
||||||
|
|
|
@ -328,21 +328,27 @@ namespace v2rayN.Views
|
||||||
case Key.V:
|
case Key.V:
|
||||||
ViewModel?.AddServerViaClipboard();
|
ViewModel?.AddServerViaClipboard();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.P:
|
case Key.P:
|
||||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Ping);
|
ViewModel?.ServerSpeedtest(ESpeedActionType.Ping);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.O:
|
case Key.O:
|
||||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Tcping);
|
ViewModel?.ServerSpeedtest(ESpeedActionType.Tcping);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.R:
|
case Key.R:
|
||||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Realping);
|
ViewModel?.ServerSpeedtest(ESpeedActionType.Realping);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.S:
|
case Key.S:
|
||||||
_ = ViewModel?.ScanScreenTaskAsync();
|
_ = ViewModel?.ScanScreenTaskAsync();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.T:
|
case Key.T:
|
||||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Speedtest);
|
ViewModel?.ServerSpeedtest(ESpeedActionType.Speedtest);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.E:
|
case Key.E:
|
||||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Mixedtest);
|
ViewModel?.ServerSpeedtest(ESpeedActionType.Mixedtest);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -309,7 +309,6 @@
|
||||||
Margin="{StaticResource SettingItemMargin}"
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="15"
|
Grid.Row="15"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
@ -335,10 +334,7 @@
|
||||||
Margin="{StaticResource SettingItemMargin}"
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
materialDesign:HintAssist.Hint="Down"
|
materialDesign:HintAssist.Hint="Down"
|
||||||
Style="{StaticResource DefTextBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
Loading…
Reference in a new issue