public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); Clipart1Image = resourceManager.GraphicResources?.Tab9_B_Clipart1; Clipart2Image = resourceManager.GraphicResources?.Tab9_B_Clipart2; Clipart3Image = resourceManager.GraphicResources?.Tab9_B_Clipart3; if (resourceManager.DataApproachesCommonFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataApproachesCommonFile.LocalPath); var itemInfoNodes = document.SelectNodes("//OurApproach/Approach")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }; foreach (var itemInfoNode in itemInfoNodes) { ApproachItems.Add(ApproachItemInfo.FromXml(itemInfoNode, resourceManager.ClipartTab15SubAFolder)); } } if (resourceManager.DataApproachPartBFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataApproachPartBFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT09B"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT09BHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT09BCombo1": if (item.IsPlaceholder) { Combo1Placeholder = item.Value; } break; case "SHIFT09BCombo2": if (item.IsPlaceholder) { Combo2Placeholder = item.Value; } break; case "SHIFT09BCombo3": if (item.IsPlaceholder) { Combo3Placeholder = item.Value; } break; case "SHIFT09BCombo4": if (item.IsPlaceholder) { Combo4Placeholder = item.Value; } break; } } Clipart1Configuration = ClipartConfiguration.FromXml(node, "SHIFT09BClipart1"); Clipart2Configuration = ClipartConfiguration.FromXml(node, "SHIFT09BClipart2"); Clipart3Configuration = ClipartConfiguration.FromXml(node, "SHIFT09BClipart3"); CommonEditorConfiguration = TextEditorConfiguration.FromXml(node); HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT09BHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT09BCombo1"); Combo2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT09BCombo2"); Combo3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT09BCombo3"); Combo4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT09BCombo4"); SubHeader1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT09BLinkText1"); SubHeader2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT09BLinkText2"); SubHeader3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT09BLinkText3"); SubHeader4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT09BLinkText4"); } }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (resourceManager.DataApproachesCommonFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataApproachesCommonFile.LocalPath); var itemInfoNodes = document.SelectNodes("//OurApproach/Approach")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }; foreach (var itemInfoNode in itemInfoNodes) { ApproachItems.Add(ApproachItemInfo.FromXml(itemInfoNode, resourceManager.ClipartTab15SubAFolder)); } } if (resourceManager.DataApproachPartCFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataApproachPartCFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT09C"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT09CHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT09CCombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "SHIFT09CTab1": Tab1DefaultItem = ApproachItems.FirstOrDefault(needsItem => String.Equals( needsItem.SubHeaderDefaultValue, childNode.Attributes? .OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "MultiBoxValue", StringComparison.OrdinalIgnoreCase))?.Value, StringComparison.OrdinalIgnoreCase)); Tab1DefaultName = childNode.Attributes? .OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "TabName", StringComparison.OrdinalIgnoreCase))?.Value; break; case "SHIFT09CTab2": Tab2DefaultItem = ApproachItems.FirstOrDefault(needsItem => String.Equals( needsItem.SubHeaderDefaultValue, childNode.Attributes? .OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "MultiBoxValue", StringComparison.OrdinalIgnoreCase))?.Value, StringComparison.OrdinalIgnoreCase)); Tab2DefaultName = childNode.Attributes? .OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "TabName", StringComparison.OrdinalIgnoreCase))?.Value; break; case "SHIFT09CTab3": Tab3DefaultItem = ApproachItems.FirstOrDefault(needsItem => String.Equals( needsItem.SubHeaderDefaultValue, childNode.Attributes? .OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "MultiBoxValue", StringComparison.OrdinalIgnoreCase))?.Value, StringComparison.OrdinalIgnoreCase)); Tab3DefaultName = childNode.Attributes? .OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "TabName", StringComparison.OrdinalIgnoreCase))?.Value; break; case "SHIFT09CTab4": Tab4DefaultItem = ApproachItems.FirstOrDefault(needsItem => String.Equals( needsItem.SubHeaderDefaultValue, childNode.Attributes? .OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "MultiBoxValue", StringComparison.OrdinalIgnoreCase))?.Value, StringComparison.OrdinalIgnoreCase)); Tab4DefaultName = childNode.Attributes? .OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "TabName", StringComparison.OrdinalIgnoreCase))?.Value; break; } } CommonEditorConfiguration = TextEditorConfiguration.FromXml(node); HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT09CHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT09CCombo1"); SubHeader1Configuration = TextEditorConfiguration.FromXml(node, "Tab1MultiBox"); SubHeader2Configuration = TextEditorConfiguration.FromXml(node, "Tab2MultiBox"); SubHeader3Configuration = TextEditorConfiguration.FromXml(node, "Tab3MultiBox"); SubHeader4Configuration = TextEditorConfiguration.FromXml(node, "Tab4MultiBox"); FormListConfiguration = FormListConfiguration.FromXml(node); } }