public Maybe <IWebProxy> Visit(UseSystemProxySettings proxySettings) { return(SystemWebProxyRetriever.GetSystemWebProxy().Select(proxy => { proxy.Credentials = string.IsNullOrWhiteSpace(proxySettings.Username) ? CredentialCache.DefaultNetworkCredentials : new NetworkCredential(proxySettings.Username, proxySettings.Password); return proxy; })); }
public IEnumerable <EnvironmentVariable> Visit(UseSystemProxySettings proxySettings) { return(SystemWebProxyRetriever.GetSystemWebProxy().SelectValueOr( proxy => { var proxyUri = proxy.GetProxy(TestUri); return GetProxyEnvironmentVariables( proxyUri.Host, proxyUri.Port, proxySettings.Username, proxySettings.Password); }, Enumerable.Empty <EnvironmentVariable>())); }