Example #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;
 }
Example #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());
     }
 }
Example #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());
            }
        }
Example #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;
        }