/// <summary> /// Initializes a new instance of the <see cref="SectionViewModel"/> class. /// </summary> /// <param name="identifier">The identifier.</param> public SectionViewModel(IdentifierInfo identifier) : this() { Assertions.AssertNotNull(identifier, "identifier"); Identifier = identifier.Name; _identifier = identifier; }
private void ParseDisplayConfigAndAdd(XDocument doc, SettingsDisplayConfiguration config) { if (!doc.IsXmlValid(Properties.Resources.SettingsInfoSchema)) { return; } foreach (XElement identifierE in doc.Root.Elements("Identifier")) { IdentifierInfo identifier = new IdentifierInfo(); identifier.Name = identifierE.Attribute("Name").Value; identifier.DisplayText = identifierE.TryGetAttributeValue("DisplayText", identifier.Name); identifier.Description = identifierE.TryGetAttributeValue("Description", null); identifier.Order = identifierE.TryGetAttributeValue("Order", 0); identifier.Parent = identifierE.TryGetAttributeValue("Parent", null); foreach (XElement settingE in identifierE.Elements("Setting")) { SettingInfo setting = new SettingInfo(); setting.Identifier = identifier.Name; setting.Name = settingE.Attribute("Name").Value; setting.Category = settingE.TryGetAttributeValue("Category", null); setting.DisplayText = settingE.TryGetAttributeValue("DisplayText", setting.Name); setting.Description = settingE.TryGetAttributeValue("Description", null); setting.Order = settingE.TryGetAttributeValue("Order", 0); setting.Editor = settingE.TryGetAttributeValue("Editor", null); setting.EditorParameter = settingE.TryGetAttributeValue("EditorParameter", null); setting.IsDynamic = settingE.TryGetAttributeValue("IsDynamic", false); identifier.Settings.Add(setting); } config.Identifiers.Add(identifier); } }