Esempio n. 1
0
 public void StoreValues(Data data, string path)
 {
     data.SetValue(@"" + path + @"NextUpdate", NextUpdate.ToString("yyyy-MM-dd HH:mm:ss"));
     data.SetValue(@"" + path + @"SettingsVersion", SettingsVersion.ToString(System.Globalization.CultureInfo.InvariantCulture));
 }
        /// <summary>
        /// Save the General.Global.ShowInformationTypes settings to the settings file
        /// </summary>
        /// <param name="infoNode">XML-node for the General.Global.ShowInformationTypes settings</param>
        public void Save(XmlNode infoNode)
        {
            string xpath;

            xpath = "./officialStatistics";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, OfficialStatistics.ToString());

            xpath = "./unit";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Unit.ToString());

            xpath = "./contact";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Contact.ToString());

            xpath = "./lastUpdated";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, LastUpdated.ToString());

            xpath = "./refPeriod";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, RefPeriod.ToString());

            xpath = "./stockFA";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, StockFa.ToString());

            xpath = "./cfPrices";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, CFPrices.ToString());

            xpath = "./dayADj";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, DayAdj.ToString());

            xpath = "./seasAdj";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, SeasAdj.ToString());

            xpath = "./basePeriod";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, BasePeriod.ToString());

            xpath = "./updateFrequency";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, UpdateFrequency.ToString());

            xpath = "./nextUpdate";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, NextUpdate.ToString());

            xpath = "./survey";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Survey.ToString());

            xpath = "./link";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Link.ToString());

            xpath = "./creationDate";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, CreationDate.ToString());

            xpath = "./copyright";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Copyright.ToString());

            xpath = "./source";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Source.ToString());

            xpath = "./matrix";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Matrix.ToString());

            xpath = "./database";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Database.ToString());
        }
Esempio n. 3
0
        public override bool Equals(object o)
        {
            if (!(o is ApplicationSettings))
            {
                return(false);
            }
            ApplicationSettings v = o as ApplicationSettings;

            if (!Accounts.Equals(v.Accounts))
            {
                return(false);
            }
            if (!JobHistory.Equals(v.JobHistory))
            {
                return(false);
            }

            if (PrinterMappings.Count != v.PrinterMappings.Count)
            {
                return(false);
            }
            for (int i = 0; i < PrinterMappings.Count; i++)
            {
                if (!PrinterMappings[i].Equals(v.PrinterMappings[i]))
                {
                    return(false);
                }
            }

            if (!RssFeed.Equals(v.RssFeed))
            {
                return(false);
            }

            if (TitleReplacement.Count != v.TitleReplacement.Count)
            {
                return(false);
            }
            for (int i = 0; i < TitleReplacement.Count; i++)
            {
                if (!TitleReplacement[i].Equals(v.TitleReplacement[i]))
                {
                    return(false);
                }
            }

            if (!UsageStatistics.Equals(v.UsageStatistics))
            {
                return(false);
            }
            if (!ConversionTimeout.Equals(v.ConversionTimeout))
            {
                return(false);
            }
            if (!EnableTips.Equals(v.EnableTips))
            {
                return(false);
            }
            if (!Language.Equals(v.Language))
            {
                return(false);
            }
            if (!LoggingLevel.Equals(v.LoggingLevel))
            {
                return(false);
            }
            if (!NextUpdate.Equals(v.NextUpdate))
            {
                return(false);
            }
            if (!UnitOfMeasurement.Equals(v.UnitOfMeasurement))
            {
                return(false);
            }
            if (!UpdateInterval.Equals(v.UpdateInterval))
            {
                return(false);
            }
            return(true);
        }