/// <summary> /// Loads files specified in file lists. /// </summary> /// <param name="documentRoot"> /// The root node of the settings document. /// </param> /// <param name="settings"> /// Stores the settings. /// </param> private static void LoadFileLists(XmlNode documentRoot, Settings settings) { Param.AssertNotNull(documentRoot, "documentRoot"); Param.AssertNotNull(settings, "settings"); XmlNodeList fileListNodes = documentRoot.SelectNodes("SourceFileList"); foreach (XmlNode fileListNode in fileListNodes) { XmlNodeList fileNodes = fileListNode.SelectNodes("SourceFile"); if (fileNodes.Count > 0) { Settings settingsForFileList = new Settings(settings.Core); XmlNode settingsNode = fileListNode.SelectSingleNode("Settings"); if (settingsNode != null) { V105Settings.Load(settingsNode, settingsForFileList); } SourceFileListSettings sourceFileListSettings = new SourceFileListSettings(settingsForFileList); foreach (XmlNode fileNode in fileNodes) { if (!string.IsNullOrEmpty(fileNode.InnerText)) { sourceFileListSettings.AddFile(fileNode.InnerText); } } settings.AddSourceFileList(sourceFileListSettings); } } }
/// <summary> /// Loads the settings from the document. /// </summary> private void LoadSettingsDocument() { // Reinitialize the settings collections. this.globalSettings.Clear(); this.parserSettings.Clear(); this.analyzerSettings.Clear(); if (this.contents != null) { // Check the version number of the file. XmlAttribute versionAttribute = this.contents.DocumentElement.Attributes["Version"]; string version = versionAttribute == null ? string.Empty : versionAttribute.Value; if (string.Equals(version, "105", StringComparison.Ordinal)) { V105Settings.Load(this.contents, this); } else if (string.Equals(version, "4.3", StringComparison.Ordinal)) { V104Settings.Load(this.contents, this); } else if (string.Equals(version, "4.2", StringComparison.Ordinal)) { V103Settings.Load(this.contents, this); } else if (string.Equals(version, "4.1", StringComparison.Ordinal)) { V102Settings.Load(this.contents, this); } else { V101Settings.Load(this.contents, this); } } }