Esempio n. 1
0
 public bool SaveProxyValidateConditionConfig()
 {
     try
     {
         ProxyValidateConditionParser.WriteConfig(proxyValidateConditionPath, proxyManager.ProxyValidator.ValidateConditions);
     }catch
     {
         return(false);
     }
     return(true);
 }
Esempio n. 2
0
        public bool LoadConfigs()
        {
            bool success = true;

            if (File.Exists(proxyInfoPath))
            {
                try
                {
                    IEnumerable <ProxyInfo> pis = ProxyInfoParser.ReadConfig(proxyInfoPath);
                    proxyManager.LoadProxies(pis);
                }catch
                {
                    success = false;
                }
            }
            if (File.Exists(proxyValidateConditionPath))
            {
                try
                {
                    IEnumerable <ProxyValidateCondition> pvcs = ProxyValidateConditionParser.ReadConfig(proxyValidateConditionPath);
                    proxyManager.ProxyValidator.LoadProxyValidations(pvcs);
                }
                catch
                {
                    success = false;
                }
            }
            if (File.Exists(proxyProviderPath))
            {
                try
                {
                    IEnumerable <AbstractProxyProvider> pvcs = ProxyProviderParser.ReadConfig(proxyProviderPath);
                    proxyManager.LoadProxyProviders(pvcs);
                }
                catch
                {
                    success = false;
                }
            }
            success &= LoadURLPatterns();
            return(success);
        }