Esempio n. 1
0
 public bool Enabled()
 {
     try
     {
         return(_proxy.Enabled());
     }
     catch (Exception e) when(e.IsRegistryAccessException())
     {
         _logger.Error("Can not access system proxy settings");
         _logger.Error(e);
         return(false);
     }
 }
        public Task OnVpnStateChanged(VpnStateChangedEventArgs e)
        {
            if (e.State.Status == VpnStatus.Connected && _proxy.Enabled() && !_modalShown)
            {
                _modalShown = true;
                _dialogs.ShowWarning(Translation.Get("Dialogs_Proxy_msg_ProxyDetected"));
            }

            if (e.State.Status == VpnStatus.Disconnected)
            {
                _modalShown = false;
            }

            return(Task.CompletedTask);
        }