Beispiel #1
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     ProxySettingService.UnsetProxy();
     IntegrationManager.INSTANCE.UnsetProxy();
     this.notifyIcon.Dispose();
 }
Beispiel #2
0
 public ManageProxy()
 {
     InitializeComponent();
     _proxySettingService = new ProxySettingService();
     FormBorderStyle      = FormBorderStyle.FixedSingle;
     MaximizeBox          = false;
     MinimizeBox          = false;
     Icon = Resources.TrayIcon;
 }
Beispiel #3
0
 public ProxyEditor(int?proxyId = null)
 {
     InitializeComponent();
     FormBorderStyle      = FormBorderStyle.FixedSingle;
     MaximizeBox          = false;
     MinimizeBox          = false;
     _proxySettingService = new ProxySettingService();
     _proxyId             = proxyId;
     Icon = Resources.TrayIcon;
     if (_proxyId.HasValue)
     {
         LoadExistingProxy();
     }
 }
Beispiel #4
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);
            }
        }
 public ContextMenus()
 {
     _proxyManager        = new ProxyManager();
     _proxySettingService = new ProxySettingService();
 }