From b6afeab1870a30be0ec370118d793501806e6b8a Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Thu, 7 Jan 2021 10:54:50 +0800 Subject: [PATCH] trim --- Netch/Controllers/NTTController.cs | 1 - Netch/Controllers/PrivoxyController.cs | 1 - Netch/Controllers/UpdateChecker.cs | 1 - Netch/Forms/MainForm.MenuStrip.cs | 6 ------ Netch/Forms/MainForm.Status.cs | 2 -- Netch/Forms/SettingForm.cs | 1 - Netch/Forms/SubscribeForm.cs | 1 - Netch/Models/Setting.cs | 4 +--- Netch/Servers/ShadowsocksR/SSRController.cs | 1 - Netch/Servers/Trojan/TrojanController.cs | 1 - Netch/Servers/VLESS/VLESS.cs | 1 - Netch/Servers/VMess/VMess.cs | 1 - Netch/Utils/Bandwidth.cs | 5 +---- Netch/Utils/HttpProxyHandler/PACServerHandle.cs | 1 - Netch/Utils/ICSHelper.cs | 1 - Netch/Utils/ServerHelper.cs | 2 +- Netch/Utils/ShareLink.cs | 1 - 17 files changed, 3 insertions(+), 28 deletions(-) diff --git a/Netch/Controllers/NTTController.cs b/Netch/Controllers/NTTController.cs index 33ead8a7b3..889906caf6 100644 --- a/Netch/Controllers/NTTController.cs +++ b/Netch/Controllers/NTTController.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics; using System.IO; using System.Linq; using Netch.Utils; diff --git a/Netch/Controllers/PrivoxyController.cs b/Netch/Controllers/PrivoxyController.cs index d43c053b81..ffe4a3d266 100644 --- a/Netch/Controllers/PrivoxyController.cs +++ b/Netch/Controllers/PrivoxyController.cs @@ -2,7 +2,6 @@ using System.Text; using Netch.Models; using Netch.Servers.Socks5; -using Netch.Utils.HttpProxyHandler; namespace Netch.Controllers { diff --git a/Netch/Controllers/UpdateChecker.cs b/Netch/Controllers/UpdateChecker.cs index 292d0f85f8..38eda55557 100644 --- a/Netch/Controllers/UpdateChecker.cs +++ b/Netch/Controllers/UpdateChecker.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net; using Netch.Models.GitHubRelease; using Netch.Utils; diff --git a/Netch/Forms/MainForm.MenuStrip.cs b/Netch/Forms/MainForm.MenuStrip.cs index 6e28019ca8..5135dfa244 100644 --- a/Netch/Forms/MainForm.MenuStrip.cs +++ b/Netch/Forms/MainForm.MenuStrip.cs @@ -1,18 +1,12 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Net; -using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Netch.Controllers; using Netch.Forms.Mode; using Netch.Models; -using Netch.Properties; using Netch.Utils; -using Netch.Utils.HttpProxyHandler; -using Newtonsoft.Json; namespace Netch.Forms { diff --git a/Netch/Forms/MainForm.Status.cs b/Netch/Forms/MainForm.Status.cs index 89bd6d4239..aadb247481 100644 --- a/Netch/Forms/MainForm.Status.cs +++ b/Netch/Forms/MainForm.Status.cs @@ -2,9 +2,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; -using Netch.Controllers; using Netch.Models; -using Netch.Servers.Socks5; using Netch.Utils; namespace Netch.Forms diff --git a/Netch/Forms/SettingForm.cs b/Netch/Forms/SettingForm.cs index 12e7c43068..28c6e9e393 100644 --- a/Netch/Forms/SettingForm.cs +++ b/Netch/Forms/SettingForm.cs @@ -1,7 +1,6 @@ using Netch.Utils; using System; using System.Collections.Generic; -using System.ComponentModel; using System.Drawing; using System.IO; using System.Linq; diff --git a/Netch/Forms/SubscribeForm.cs b/Netch/Forms/SubscribeForm.cs index e9fef796a0..a4c3558f57 100644 --- a/Netch/Forms/SubscribeForm.cs +++ b/Netch/Forms/SubscribeForm.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel; using System.Linq; using System.Windows.Forms; using Netch.Models; diff --git a/Netch/Models/Setting.cs b/Netch/Models/Setting.cs index b87f508a10..f2578317d0 100644 --- a/Netch/Models/Setting.cs +++ b/Netch/Models/Setting.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; namespace Netch.Models { diff --git a/Netch/Servers/ShadowsocksR/SSRController.cs b/Netch/Servers/ShadowsocksR/SSRController.cs index f62eec3c05..43efed4c44 100644 --- a/Netch/Servers/ShadowsocksR/SSRController.cs +++ b/Netch/Servers/ShadowsocksR/SSRController.cs @@ -1,7 +1,6 @@ using System.Text; using Netch.Controllers; using Netch.Models; -using Netch.Utils; namespace Netch.Servers.ShadowsocksR { diff --git a/Netch/Servers/Trojan/TrojanController.cs b/Netch/Servers/Trojan/TrojanController.cs index fe2490bfdd..2b2aaeb95e 100644 --- a/Netch/Servers/Trojan/TrojanController.cs +++ b/Netch/Servers/Trojan/TrojanController.cs @@ -3,7 +3,6 @@ using Netch.Controllers; using Netch.Models; using Netch.Servers.Trojan.Models; -using Netch.Utils; using Newtonsoft.Json; namespace Netch.Servers.Trojan diff --git a/Netch/Servers/VLESS/VLESS.cs b/Netch/Servers/VLESS/VLESS.cs index fead21598f..c8cfaeb49b 100644 --- a/Netch/Servers/VLESS/VLESS.cs +++ b/Netch/Servers/VLESS/VLESS.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Netch.Models; using Netch.Servers.VMess; namespace Netch.Servers.VLESS diff --git a/Netch/Servers/VMess/VMess.cs b/Netch/Servers/VMess/VMess.cs index c826001f58..a0b0b0659a 100644 --- a/Netch/Servers/VMess/VMess.cs +++ b/Netch/Servers/VMess/VMess.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using Netch.Models; diff --git a/Netch/Utils/Bandwidth.cs b/Netch/Utils/Bandwidth.cs index 852f403241..43194b78fa 100644 --- a/Netch/Utils/Bandwidth.cs +++ b/Netch/Utils/Bandwidth.cs @@ -1,15 +1,12 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.Diagnostics.Tracing.Parsers; using Microsoft.Diagnostics.Tracing.Session; using Netch.Controllers; -using Netch.Forms; using Netch.Models; using Netch.Servers.Shadowsocks; -using Netch.Servers.Socks5; namespace Netch.Utils { diff --git a/Netch/Utils/HttpProxyHandler/PACServerHandle.cs b/Netch/Utils/HttpProxyHandler/PACServerHandle.cs index 84aefa7a99..fcad45a01d 100644 --- a/Netch/Utils/HttpProxyHandler/PACServerHandle.cs +++ b/Netch/Utils/HttpProxyHandler/PACServerHandle.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Net; using System.Text; diff --git a/Netch/Utils/ICSHelper.cs b/Netch/Utils/ICSHelper.cs index bbb7662f4e..d0dea2d615 100644 --- a/Netch/Utils/ICSHelper.cs +++ b/Netch/Utils/ICSHelper.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using System.Management; using Netch.Controllers; using Netch.Models.WinFW; diff --git a/Netch/Utils/ServerHelper.cs b/Netch/Utils/ServerHelper.cs index c6da5154ad..1c45afb3af 100644 --- a/Netch/Utils/ServerHelper.cs +++ b/Netch/Utils/ServerHelper.cs @@ -13,7 +13,7 @@ public static class ServerHelper static ServerHelper() { - var serversUtilsTypes = Assembly.GetExecutingAssembly().GetExportedTypes().Where(type => type.GetInterfaces().Any(t => t == typeof(IServerUtil))); + var serversUtilsTypes = Assembly.GetExecutingAssembly().GetExportedTypes().Where(type => type.GetInterfaces().Contains(typeof(IServerUtil))); ServerUtils = serversUtilsTypes.Select(t => (IServerUtil) Activator.CreateInstance(t)).OrderBy(util => util.Priority); } diff --git a/Netch/Utils/ShareLink.cs b/Netch/Utils/ShareLink.cs index b40eb1d153..829a565bfc 100644 --- a/Netch/Utils/ShareLink.cs +++ b/Netch/Utils/ShareLink.cs @@ -5,7 +5,6 @@ using System.Text; using Netch.Servers.Shadowsocks; using Netch.Servers.Shadowsocks.Models; -using Netch.Servers.VMess; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Server = Netch.Models.Server;