refactor: Remove Server argument in IModeController.Start

This commit is contained in:
ChsBuffer
2020-10-15 19:17:04 +08:00
parent 918e260f3e
commit 1b6fe29085
5 changed files with 5 additions and 7 deletions

View File

@@ -23,10 +23,9 @@ namespace Netch.Controllers
/// <summary>
/// 启动
/// </summary>
/// <param name="s">服务器</param>
/// <param name="mode">模式</param>
/// <returns>是否启动成功</returns>
public bool Start(Server s, Mode mode)
public bool Start(Mode mode)
{
RecordPrevious();

View File

@@ -7,9 +7,8 @@ namespace Netch.Controllers
/// <summary>
/// 启动
/// </summary>
/// <param name="s">服务器</param>
/// <param name="mode">模式</param>
/// <returns>是否成功</returns>
public abstract bool Start(Server s, Mode mode);
public abstract bool Start(Mode mode);
}
}

View File

@@ -157,7 +157,7 @@ namespace Netch.Controllers
}
Global.MainForm.StatusText(i18N.TranslateFormat("Starting {0}", ModeController.Name));
if (await Task.Run(() => ModeController.Start(server, mode)))
if (await Task.Run(() => ModeController.Start(mode)))
{
switch (mode.Type)
{

View File

@@ -45,7 +45,7 @@ namespace Netch.Controllers
BinDriver = "bin\\" + fileName;
}
public bool Start(Server s, Mode mode)
public bool Start(Mode mode)
{
Logging.Info("内置驱动版本: " + Utils.Utils.GetFileVersion(BinDriver));
if (Utils.Utils.GetFileVersion(SystemDriver) != Utils.Utils.GetFileVersion(BinDriver))

View File

@@ -39,7 +39,7 @@ namespace Netch.Controllers
public override string Name { get; protected set; } = "tun2socks";
public override string MainFile { get; protected set; } = "tun2socks.exe";
public bool Start(Server s, Mode mode)
public bool Start(Mode mode)
{
_savedMode = mode;
_savedServer = MainController.ServerController.Server;