diff --git a/Netch/Forms/MainForm.cs b/Netch/Forms/MainForm.cs index fed53c1f..3c06e980 100644 --- a/Netch/Forms/MainForm.cs +++ b/Netch/Forms/MainForm.cs @@ -16,6 +16,7 @@ using System.Threading.Tasks; using System.Windows.Forms; using Netch.Enums; using Netch.Interfaces; +using Netch.Services; namespace Netch.Forms { @@ -413,7 +414,7 @@ namespace Netch.Forms try { - await Updater.Updater.DownloadAndUpdate(Path.Combine(Global.NetchDir, "data"), + await Updater.DownloadAndUpdate(Path.Combine(Global.NetchDir, "data"), Global.NetchDir, (_, args) => BeginInvoke(new Action(() => NewVersionLabel.Text = $"{args.ProgressPercentage}%"))); } diff --git a/Netch/Netch.cs b/Netch/Netch.cs index 3dcda64c..23ef4d22 100644 --- a/Netch/Netch.cs +++ b/Netch/Netch.cs @@ -1,6 +1,7 @@ using Netch.Controllers; using Netch.Forms; using Netch.Utils; +using Netch.Services; using System; using System.Collections.Generic; using System.IO; @@ -38,7 +39,7 @@ namespace Netch Environment.SetEnvironmentVariable("PATH", $"{Environment.GetEnvironmentVariable("PATH")};{binPath}"); AddDllDirectory(binPath); - Updater.Updater.CleanOld(Global.NetchDir); + Updater.CleanOld(Global.NetchDir); // 预创建目录 var directories = new[] { "mode\\Custom", "data", "i18n", "logging" }; diff --git a/Netch/Updater/Updater.cs b/Netch/Services/Updater.cs similarity index 99% rename from Netch/Updater/Updater.cs rename to Netch/Services/Updater.cs index 95228d7a..4e540751 100644 --- a/Netch/Updater/Updater.cs +++ b/Netch/Services/Updater.cs @@ -1,7 +1,3 @@ -using Netch.Controllers; -using Netch.Models; -using Netch.Properties; -using Netch.Utils; using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -11,8 +7,12 @@ using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; +using Netch.Controllers; +using Netch.Models; +using Netch.Properties; +using Netch.Utils; -namespace Netch.Updater +namespace Netch.Services { public class Updater {