diff --git a/Netch/Controllers/NTTController.cs b/Netch/Controllers/NTTController.cs index 33ead8a7..889906ca 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 d43c053b..ffe4a3d2 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 292d0f85..38eda555 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 6e28019c..5135dfa2 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 89bd6d42..aadb2474 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 12e7c430..28c6e9e3 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 e9fef796..a4c3558f 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 b87f508a..f2578317 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 f62eec3c..43efed4c 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 fe2490bf..2b2aaeb9 100644 --- a/Netch/Servers/Trojan/TrojanController.cs +++ b/Netch/Servers/Trojan/TrojanController.cs @@ -3,7 +3,6 @@ using System.IO; 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 fead2159..c8cfaeb4 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 c826001f..a0b0b065 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 852f4032..43194b78 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 84aefa7a..fcad45a0 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 bbb7662f..d0dea2d6 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 c6da5154..1c45afb3 100644 --- a/Netch/Utils/ServerHelper.cs +++ b/Netch/Utils/ServerHelper.cs @@ -13,7 +13,7 @@ namespace Netch.Utils 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 b40eb1d1..829a565b 100644 --- a/Netch/Utils/ShareLink.cs +++ b/Netch/Utils/ShareLink.cs @@ -5,7 +5,6 @@ using System.Linq; 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;