Optimized code

This commit is contained in:
AmazingDM
2021-01-05 17:11:11 +08:00
parent 8a551b715e
commit f7ad2baa52
2 changed files with 3 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ namespace Netch.Controllers
if (mode.Type == 3)
{
if ((MainController.Server.Type == "Socks5" || MainController.Server.Type == "Trojan") && mode.BypassChina)
if ((MainController.Server.Type is "Socks5" or "Trojan") && mode.BypassChina)
{
//启动PAC服务器
PACServerHandle.InitPACServer("127.0.0.1");

View File

@@ -72,7 +72,7 @@ namespace Netch.Forms
//Socks5
Boolean s5BwFlag = true;
if (MainController.Server.Type == "Socks5")
if (MainController.Server.Type is "Socks5")
{
Socks5 SocksServer = (Socks5) MainController.Server;
@@ -80,7 +80,7 @@ namespace Netch.Forms
}
//Socks5无身份验证且为网页代理模式时无法统计流量不显示流量状态栏Socks5有身份验证时将统计V2ray的流量
if (s5BwFlag || (MainController.Mode.Type == 0 || MainController.Mode.Type == 1 || MainController.Mode.Type == 2))
if (s5BwFlag || Models.ModeExtension.TestNatRequired(MainController.Mode))
UsedBandwidthLabel.Visible /*= UploadSpeedLabel.Visible*/ = DownloadSpeedLabel.Visible = Global.Flags.IsWindows10Upper;
break;
case State.Stopping: