protected override void OnExit(ExitEventArgs e) { base.OnExit(e); ProxySettingService.UnsetProxy(); IntegrationManager.INSTANCE.UnsetProxy(); this.notifyIcon.Dispose(); }
public static void CheckAndSetProxy() { var ssid = NetworkService.GetConnectingSSID(); if (ssid == string.Empty) { return; } var settings = AutoProxyConfig.Current.Proxy.FindSetting(ssid); if (settings.Count != 0) { var setting = settings.First(); ProxySettingService.SetProxy(setting); IntegrationManager.INSTANCE.SetProxy(setting); NotificationService.SendNotify(Resources.SetProxy, $"SSID: {ssid}"); } else { ProxySettingService.UnsetProxy(); IntegrationManager.INSTANCE.UnsetProxy(); NotificationService.SendNotify(Resources.UnsetProxy); } }