Example #1
0
// ReSharper disable RedundantAssignment
        public void InputProxyCredentials(IProxyCompatible proxyProtocol, ref bool retry)
// ReSharper restore RedundantAssignment
        {
            using (var proxy = new ProxyForm(_client.ClientConfig))
            {
                if (proxy.ShowDialog() == DialogResult.OK)
                {
                    proxyProtocol.Proxy.Credentials = new NetworkCredential(_client.ClientConfig.ProxyUserName,
                                                                            _client.ClientConfig.ProxyPassword,
                                                                            _client.ClientConfig.ProxyDomain);
                    retry = true;
                }
                else
                {
                    retry = false;
                }
            }
        }
Example #2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Saisie des informations d'authentification sur le proxy
        /// </summary>
        /// <param name="proxyProtocol">le protocol IProxyCompatible à alterer</param>
        /// <param name="retry">pour permettre les essais multiples</param>
        /// -----------------------------------------------------------------------------
// ReSharper disable RedundantAssignment
        public void InputProxyCredentials(IProxyCompatible proxyProtocol, ref bool retry)
// ReSharper restore RedundantAssignment
        {
            using (var proxy = new ProxyForm(_client.ClientConfig))
            {
	            if (proxy.ShowDialog() == DialogResult.OK)
	            {
		            proxyProtocol.Proxy.Credentials = new NetworkCredential(_client.ClientConfig.ProxyUserName,
		                                                                    _client.ClientConfig.ProxyPassword,
		                                                                    _client.ClientConfig.ProxyDomain);
		            retry = true;
	            }
	            else
		            retry = false;
            }
        }