Refactor: Merge MainForm

This commit is contained in:
ChsBuffer
2021-01-15 16:24:59 +08:00
parent 5ff26e97b4
commit c9da7197ba
9 changed files with 1210 additions and 1309 deletions

View File

@@ -97,8 +97,8 @@ namespace Netch.Controllers
if (!await StartMode(mode))
throw new StartFailedException();
if (mode.TestNatRequired())
NatTest();
_ = Task.Run(Bandwidth.NetTraffic);
_ = Task.Run(NatTest);
return true;
}
@@ -210,7 +210,6 @@ namespace Netch.Controllers
ServerController = null;
}
/// <summary>
/// 检查端口是否被占用,
/// 被占用则弹窗提示, 确认后抛出异常
@@ -239,6 +238,8 @@ namespace Netch.Controllers
/// </summary>
public static void NatTest()
{
if (!Mode.TestNatRequired())
return;
NttTested = false;
Task.Run(() =>
{