Пример #1
0
        /// <summary>
        /// Fills the global settings data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        private void FillGlobalSettingsDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var table = dataSet.Tables[0];

                var parameters = config.XPathSelectElements(Documenter.GetMetaverseXmlRootXPath(pilotConfig) + "/mv-data//parameter-values/parameter");

                // Sort by name
                parameters                       = from parameter in parameters
                                        let name = (string)parameter.Attribute("name")
                                                   orderby name
                                                   select parameter;

                for (var parameterIndex = 0; parameterIndex < parameters.Count(); ++parameterIndex)
                {
                    var parameter = parameters.ElementAt(parameterIndex);
                    Documenter.AddRow(table, new object[] { (string)parameter.Attribute("name"), (string)parameter });
                }

                table.AcceptChanges();
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }