Beispiel #1
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     ProxySettingService.UnsetProxy();
     IntegrationManager.INSTANCE.UnsetProxy();
     this.notifyIcon.Dispose();
 }
Beispiel #2
0
        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);
            }
        }