Exemple #1
0
        private void LoadFxASettings(IniData data)
        {
            var fxaSettings = default(FxASettings);

            if (ContainsSettingsConfig(data, "FxA", "BaseURL"))
            {
                fxaSettings.BaseURL = data["FxA"]["BaseURL"];
                ProductConstants.LoadFxAUrls(fxaSettings.BaseURL);
            }
            else
            {
                ProductConstants.LoadFxAUrls();
            }

            if (ContainsSettingsConfig(data, "FxA", "Token"))
            {
                fxaSettings.Token = data["FxA"]["Token"];
            }

            if (ContainsSettingsConfig(data, "FxA", "PublicKey"))
            {
                fxaSettings.PublicKey = data["FxA"]["PublicKey"];
            }

            fxa = fxaSettings;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Settings"/> class.
        /// </summary>
        /// <param name="filename">Filename for file to load settings from.</param>
        public Settings(string filename)
        {
            this.filename = filename;
            var loadedFromFile = LoadSettingsFromFile(filename);

            if (!loadedFromFile)
            {
                fxa      = default(FxASettings);
                language = default(LanguageSettings);
                network  = default(NetworkSettings);
                ProductConstants.LoadFxAUrls();
            }

            // Configure the VPN allowed IPs
            ProductConstants.AllowedIPs = network.AllowLocalDeviceAccess ? ProductConstants.DefaultAllowedIPsLocal : ProductConstants.DefaultAllowedIPs;
        }