示例#1
0
 private void Init()
 {
     var config = new FirefoxConfigReader();
     init = true;
     using (var file = new FirefoxConfigFile()) {
         TextReader reader = file.GetProfileFileReader();
         if (reader == null)
             return;
         profileName = config.GetProfileName(reader);
         file.SetConfigFileName(profileName);
         reader = file.GetConfigFileReader();
         if (reader == null)
             return;
         config.LoadConfig(reader);
     }
     detected = true;
 }
示例#2
0
 public override void SetBrowserSettings(BrowserSettings settings)
 {
     if (!init)
         Init();
     var config = new FirefoxConfigReader();
     using (var file = new FirefoxConfigFile()) {
         file.SetConfigFileName(profileName);
         var reader = file.GetConfigFileReader();
         if (reader == null)
             return;
         config.LoadConfig(reader);
         reader.Dispose();
         config.SetHomePage(settings.HomePage);
         config.SetProxySettings(settings.Proxy);
         config.SaveConfig(file.GetConfigFileWriter());
     }
 }
示例#3
0
        public override void SetBrowserSettings(BrowserSettings settings)
        {
            if (!init)
            {
                Init();
            }
            var config = new FirefoxConfigReader();

            using (var file = new FirefoxConfigFile()) {
                file.SetConfigFileName(profileName);
                var reader = file.GetConfigFileReader();
                if (reader == null)
                {
                    return;
                }
                config.LoadConfig(reader);
                reader.Dispose();
                config.SetHomePage(settings.HomePage);
                config.SetProxySettings(settings.Proxy);
                config.SaveConfig(file.GetConfigFileWriter());
            }
        }
示例#4
0
        private void Init()
        {
            var config = new FirefoxConfigReader();

            init = true;
            using (var file = new FirefoxConfigFile()) {
                TextReader reader = file.GetProfileFileReader();
                if (reader == null)
                {
                    return;
                }
                profileName = config.GetProfileName(reader);
                file.SetConfigFileName(profileName);
                reader = file.GetConfigFileReader();
                if (reader == null)
                {
                    return;
                }
                config.LoadConfig(reader);
            }
            detected = true;
        }