public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (resourceManager.DataNeedsCommonFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataNeedsCommonFile.LocalPath); var itemInfoNodes = document.SelectNodes("//SHIFTNeeds/Need")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }; foreach (var itemInfoNode in itemInfoNodes) { NeedsList.Add(NeedsItemInfo.FromXml(itemInfoNode, resourceManager.ClipartTab7SubAFolder)); } } if (resourceManager.DataNeedsSolutionsPartAFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataNeedsSolutionsPartAFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT07A"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT07AHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT07ACombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; } } TabSelector = TabSelectorConfiguration.FromXml(node, "SHIFT07ATabStrip1"); CommonEditorConfiguration = TextEditorConfiguration.FromXml(node); HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT07AHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07ACombo1"); foreach (var itemInfo in NeedsList) { itemInfo.SubheaderConfiguration = TextEditorConfiguration.FromXml(node, String.Format("NeedButton{0}", itemInfo.Id)); } } }
public void LoadData() { if (_isConfigured) { return; } if (!File.Exists(_sourceFilePath)) { return; } var document = new XmlDocument(); document.Load(_sourceFilePath); var configNode = document.SelectSingleNode("//Settings"); if (configNode == null) { return; } foreach (var node in configNode.SelectNodes("./SolutionHeader")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }) { HeaderItems.Add(ListDataItem.FromXml(node)); } foreach (var node in configNode.SelectNodes("./SolutionCombo1")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }) { Combo1Items.Add(ListDataItem.FromXml(node)); } foreach (var node in configNode.SelectNodes("./Toggles/Toggle")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }) { var id = node.Attributes?.OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "Id", StringComparison.OrdinalIgnoreCase))?.Value?.ToLower(); switch (id) { case PositioningId: Positioning = PositioningInfo.FromXml(node); break; case ResearchId: Research = ResearchInfo.FromXml(node); break; case StyleId: Style = StyleInfo.FromXml(node, _imagesFolder, ProductId); break; } } HeaderConfiguration = TextEditorConfiguration.FromXml(configNode, "SolutionHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(configNode, "SolutionCombo1"); _isConfigured = true; }
public void LoadData() { if (_isConfigured) { return; } if (!File.Exists(_sourceFilePath)) { return; } var document = new XmlDocument(); document.Load(_sourceFilePath); var configNode = document.SelectSingleNode("//Settings"); if (configNode == null) { return; } foreach (var node in configNode.SelectNodes("./MediaPlan/Description/Item")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }) { MemoPopup1Items.Add(ListDataItem.FromXml(node)); } foreach (var node in configNode.SelectNodes("./MediaPlan/SizeSpecs/Item")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }) { Combo1Items.Add(ListDataItem.FromXml(node)); } foreach (var node in configNode.SelectNodes("./MediaPlan/Quantity/Item")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }) { Combo2Items.Add(ListDataItem.FromXml(node)); } foreach (var node in configNode.SelectNodes("./MediaPlan/Investment/Item")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }) { Combo3Items.Add(ListDataItem.FromXml(node)); } _isConfigured = true; }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (!resourceManager.DataMarketPartCFile.ExistsLocal()) { return; } var document = new XmlDocument(); document.Load(resourceManager.DataMarketPartCFile.LocalPath); var node = document.SelectSingleNode(@"/CP07C"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "CP07CHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "CP07CCombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; } } Clipart1Configuration = ClipartConfiguration.FromXml(node, "CP07CClipart1"); Clipart2Configuration = ClipartConfiguration.FromXml(node, "CP07CClipart2"); Clipart3Configuration = ClipartConfiguration.FromXml(node, "CP07CClipart3"); Clipart4Configuration = ClipartConfiguration.FromXml(node, "CP07CClipart4"); }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (!resourceManager.DataPartnershipPartAFile.ExistsLocal()) { return; } var document = new XmlDocument(); document.Load(resourceManager.DataPartnershipPartAFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT06A"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT06AHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT06ACombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "SHIFT06ACombo2": if (!String.IsNullOrEmpty(item.Value)) { Combo2Items.Add(item); } break; case "SHIFT06ACombo3": if (!String.IsNullOrEmpty(item.Value)) { Combo3Items.Add(item); } break; case "SHIFT06ACombo4": if (!String.IsNullOrEmpty(item.Value)) { Combo4Items.Add(item); } break; case "SHIFT06ASubheader1": if (item.IsPlaceholder) { SubHeader1Placeholder = item.Value; } else { SubHeader1DefaultValue = item.Value; } break; case "SHIFT06ASubheader2": if (item.IsPlaceholder) { SubHeader2Placeholder = item.Value; } else { SubHeader2DefaultValue = item.Value; } break; case "SHIFT06ASubheader3": if (item.IsPlaceholder) { SubHeader3Placeholder = item.Value; } else { SubHeader3DefaultValue = item.Value; } break; case "SHIFT06ASubheader4": if (item.IsPlaceholder) { SubHeader4Placeholder = item.Value; } else { SubHeader4DefaultValue = item.Value; } break; } } Clipart1Configuration = ClipartConfiguration.FromXml(node, "SHIFT06AClipart1"); Clipart2Configuration = ClipartConfiguration.FromXml(node, "SHIFT06AClipart2"); CommonEditorConfiguration = TextEditorConfiguration.FromXml(node); HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT06AHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT06ACombo1"); Combo2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT06ACombo2"); Combo3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT06ACombo3"); Combo4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT06ACombo4"); SubHeader1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT06ASubheader1"); SubHeader2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT06ASubheader2"); SubHeader3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT06ASubheader3"); SubHeader4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT06ASubheader4"); }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (!resourceManager.DataSharePartAFile.ExistsLocal()) { return; } var document = new XmlDocument(); document.Load(resourceManager.DataSharePartAFile.LocalPath); var node = document.SelectSingleNode(@"/CP05A"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "CP05AHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "CP05ABillionCombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "CP05APercentCombo2": if (!String.IsNullOrEmpty(item.Value)) { Combo2Items.Add(item); } break; case "CP05APopulationCombo3": if (!String.IsNullOrEmpty(item.Value)) { Combo3Items.Add(item); } break; case "CP05ASharePointCombo4": if (!String.IsNullOrEmpty(item.Value)) { Combo4Items.Add(item); } break; case "CP05ASubHeader1": if (item.IsPlaceholder) { SubHeader1Placeholder = item.Value; } else { SubHeader1DefaultValue = item.Value; } break; case "CP05ASubHeader2": SubHeader2DefaultValue = Decimal.Parse(item.Value ?? "0", NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands); break; case "CP05ASubHeader3": if (item.IsPlaceholder) { SubHeader3Placeholder = item.Value; } else { SubHeader3DefaultValue = item.Value; } break; case "CP05ASubHeader4": if (item.IsPlaceholder) { SubHeader4Placeholder = item.Value; } else { SubHeader4DefaultValue = item.Value; } break; case "CP05ASubHeader5": if (item.IsPlaceholder) { SubHeader5Placeholder = item.Value; } else { SubHeader5DefaultValue = item.Value; } break; case "CP05ASubHeader6": if (item.IsPlaceholder) { SubHeader6Placeholder = item.Value; } else { SubHeader6DefaultValue = item.Value; } break; case "CP05ASubHeader7": if (item.IsPlaceholder) { SubHeader7Placeholder = item.Value; } else { SubHeader7DefaultValue = item.Value; } break; } } Clipart1Configuration = ClipartConfiguration.FromXml(node, "CP05AClipart1"); Clipart2Configuration = ClipartConfiguration.FromXml(node, "CP05AClipart2"); Clipart3Configuration = ClipartConfiguration.FromXml(node, "CP05AClipart3"); }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (resourceManager.DataNextStepsPartIFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataNextStepsPartIFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT14I"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT14IHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT14ICombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "SHIFT14ICombo2": if (!String.IsNullOrEmpty(item.Value)) { Combo2Items.Add(item); } break; case "SHIFT14ICombo3": if (!String.IsNullOrEmpty(item.Value)) { Combo3Items.Add(item); } break; case "SHIFT14ICombo4": if (!String.IsNullOrEmpty(item.Value)) { Combo4Items.Add(item); } break; case "SHIFT14ICombo5": if (!String.IsNullOrEmpty(item.Value)) { Combo5Items.Add(item); } break; case "SHIFT14ITAB1SHUBHEADER1": if (item.IsPlaceholder) { SubHeader1Placeholder = item.Value; } else { SubHeader1DefaultValue = item.Value; } break; case "SHIFT14ITAB2SHUBHEADER1": if (item.IsPlaceholder) { SubHeader2Placeholder = item.Value; } else { SubHeader2DefaultValue = item.Value; } break; case "SHIFT14ITAB3SHUBHEADER1": if (item.IsPlaceholder) { SubHeader3Placeholder = item.Value; } else { SubHeader3DefaultValue = item.Value; } break; case "SHIFT14ITAB4SHUBHEADER1": if (item.IsPlaceholder) { SubHeader4Placeholder = item.Value; } else { SubHeader4DefaultValue = item.Value; } break; case "SHIFT14ITAB5SHUBHEADER1": if (item.IsPlaceholder) { SubHeader5Placeholder = item.Value; } else { SubHeader5DefaultValue = item.Value; } break; case "SHIFT14ITAB6SHUBHEADER1": if (item.IsPlaceholder) { SubHeader6Placeholder = item.Value; } else { SubHeader6DefaultValue = item.Value; } break; } } Clipart1Configuration = ClipartConfiguration.FromXml(node, "SHIFT14IClipart1"); Clipart2Configuration = ClipartConfiguration.FromXml(node, "SHIFT14IClipart2"); Clipart3Configuration = ClipartConfiguration.FromXml(node, "SHIFT14IClipart3"); CommonEditorConfiguration = TextEditorConfiguration.FromXml(node); HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT14IHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ICombo1"); Combo2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ICombo2"); Combo3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ICombo3"); Combo4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ICombo4"); Combo5Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ICombo5"); SubHeader1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ITAB1SHUBHEADER1"); SubHeader2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ITAB2SHUBHEADER1"); SubHeader3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ITAB3SHUBHEADER1"); SubHeader4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ITAB4SHUBHEADER1"); SubHeader5Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ITAB5SHUBHEADER1"); SubHeader6Configuration = TextEditorConfiguration.FromXml(node, "SHIFT14ITAB6SHUBHEADER1"); } if (resourceManager.DataNextStepsCommonFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataNextStepsCommonFile.LocalPath); var comboLists = new[] { Combo1Items, Combo2Items, Combo3Items, Combo4Items, Combo5Items }; var proofNodes = document.SelectNodes("//SHIFTNextSteps/Item")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }; foreach (var proofNode in proofNodes) { var nodeValue = proofNode.Attributes?.OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "Description", StringComparison.OrdinalIgnoreCase))?.Value; if (!String.IsNullOrWhiteSpace(nodeValue)) { foreach (var comboList in comboLists) { if (!comboList.Any(item => String.Equals(nodeValue, item.Value, StringComparison.OrdinalIgnoreCase))) { comboList.Add(ListDataItem.FromString(nodeValue)); } } } } } }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (!resourceManager.DataMarketPartBFile.ExistsLocal()) { return; } var document = new XmlDocument(); document.Load(resourceManager.DataMarketPartBFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT05B"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT05BHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT05BCombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "SHIFT05BMULTIBOX1": MemoPopup1DefaultItem = item; break; case "SHIFT05BMULTIBOX2": MemoPopup2DefaultItem = item; break; case "SHIFT05BMULTIBOX3": MemoPopup3DefaultItem = item; break; case "SHIFT05BSubheader1": SubHeader1DefaultValue = Decimal.Parse((item.Value ?? "0").Replace(CultureInfo.CurrentCulture.NumberFormat.PercentSymbol, String.Empty), NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands); break; case "SHIFT05BSubheader2": if (item.IsPlaceholder) { SubHeader2Placeholder = item.Value; } else { SubHeader2DefaultValue = item.Value; } break; case "SHIFT05BSubheader3": SubHeader3DefaultValue = Decimal.Parse((item.Value ?? "0").Replace(CultureInfo.CurrentCulture.NumberFormat.PercentSymbol, String.Empty), NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands); break; case "SHIFT05BSubheader4": SubHeader4DefaultValue = Decimal.Parse((item.Value ?? "0").Replace(CultureInfo.CurrentCulture.NumberFormat.PercentSymbol, String.Empty), NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands); break; case "SHIFT05BSubheader5": SubHeader5DefaultValue = Decimal.Parse((item.Value ?? "0").Replace(CultureInfo.CurrentCulture.NumberFormat.PercentSymbol, String.Empty), NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands); break; } } Clipart1Configuration = ClipartConfiguration.FromXml(node, "SHIFT05BClipart1"); Clipart2Configuration = ClipartConfiguration.FromXml(node, "SHIFT05BClipart2"); Clipart3Configuration = ClipartConfiguration.FromXml(node, "SHIFT05BClipart3"); Clipart4Configuration = ClipartConfiguration.FromXml(node, "SHIFT05BClipart4"); Clipart5Configuration = ClipartConfiguration.FromXml(node, "SHIFT05BClipart5"); CommonEditorConfiguration = TextEditorConfiguration.FromXml(node); HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT05BHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT05BCombo1"); MemoPopup1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT05BMULTIBOX1"); MemoPopup2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT05BMULTIBOX2"); MemoPopup3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT05BMULTIBOX3"); SubHeader1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT05BSubheader1"); SubHeader2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT05BSubheader2"); SubHeader3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT05BSubheader3"); SubHeader4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT05BSubheader4"); SubHeader5Configuration = TextEditorConfiguration.FromXml(node, "SHIFT05BSubheader5"); }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (!resourceManager.DataClosersPartBFile.ExistsLocal()) { return; } var document = new XmlDocument(); document.Load(resourceManager.DataClosersPartBFile.LocalPath); var node = document.SelectSingleNode(@"/CP11B"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "CP11BHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "CP11BCombo0": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "CP11BCombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo2Items.Add(item); } break; case "CP11BCombo2": if (!String.IsNullOrEmpty(item.Value)) { Combo3Items.Add(item); } break; case "CP11BCombo3": if (!String.IsNullOrEmpty(item.Value)) { Combo4Items.Add(item); } break; case "CP11BSubheader1": if (item.IsPlaceholder) { SubHeader1Placeholder = item.Value; } else { SubHeader1DefaultValue = item.Value; } break; case "CP11BSubheader2": if (item.IsPlaceholder) { SubHeader2Placeholder = item.Value; } else { SubHeader2DefaultValue = item.Value; } break; case "CP11BSubheader3": if (item.IsPlaceholder) { SubHeader3Placeholder = item.Value; } else { SubHeader3DefaultValue = item.Value; } break; } } Clipart1Configuration = ClipartConfiguration.FromXml(node, "CP11BClipart1"); Clipart2Configuration = ClipartConfiguration.FromXml(node, "CP11BClipart2"); }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (!resourceManager.DataAgendaPartDFile.ExistsLocal()) { return; } var document = new XmlDocument(); document.Load(resourceManager.DataAgendaPartDFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT03D"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT03DHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT03DCombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "SHIFT03DCombo2": if (!String.IsNullOrEmpty(item.Value)) { Combo2Items.Add(item); } break; case "SHIFT03DCombo3": if (!String.IsNullOrEmpty(item.Value)) { Combo3Items.Add(item); } break; case "SHIFT03DCombo4": if (!String.IsNullOrEmpty(item.Value)) { Combo4Items.Add(item); } break; case "SHIFT03DCombo5": if (!String.IsNullOrEmpty(item.Value)) { Combo5Items.Add(item); } break; } } Clipart1Configuration = ClipartConfiguration.FromXml(node, "SHIFT03DClipart1"); CommonEditorConfiguration = TextEditorConfiguration.FromXml(node); HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT03DHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03DCombo1"); Combo2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03DCombo2"); Combo3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03DCombo3"); Combo4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03DCombo4"); Combo5Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03DCombo5"); }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (resourceManager.DataAgendaPartEFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataAgendaPartEFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT03E"); if (node == null) { return; } Tab1Title = node.SelectSingleNode("./SHIFT03ETab1Name")?.Attributes ?.OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "Value", StringComparison.OrdinalIgnoreCase))?.Value ?? "Goals"; Tab2Title = node.SelectSingleNode("./SHIFT03ETab2Name")?.Attributes ?.OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "Value", StringComparison.OrdinalIgnoreCase))?.Value ?? "Strategy"; Tab3Title = node.SelectSingleNode("./SHIFT03ETab3Name")?.Attributes ?.OfType <XmlAttribute>() .FirstOrDefault(a => String.Equals(a.Name, "Value", StringComparison.OrdinalIgnoreCase))?.Value ?? "Tactics"; foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT03EHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT03EMULTIBOX1": if (!String.IsNullOrEmpty(item.Value)) { MemoPopup1Items.Add(item); } break; case "SHIFT03EMULTIBOX2": if (!String.IsNullOrEmpty(item.Value)) { MemoPopup2Items.Add(item); } break; case "SHIFT03EMULTIBOX3": if (!String.IsNullOrEmpty(item.Value)) { MemoPopup3Items.Add(item); } break; case "SHIFT03EMULTIBOX4": if (!String.IsNullOrEmpty(item.Value)) { MemoPopup4Items.Add(item); } break; case "SHIFT03EMULTIBOX5": if (!String.IsNullOrEmpty(item.Value)) { MemoPopup5Items.Add(item); } break; case "SHIFT03EMULTIBOX6": if (!String.IsNullOrEmpty(item.Value)) { MemoPopup6Items.Add(item); } break; case "SHIFT03ECOMBO1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "SHIFT03ECOMBO2": if (!String.IsNullOrEmpty(item.Value)) { Combo2Items.Add(item); } break; case "SHIFT03ECOMBO3": if (!String.IsNullOrEmpty(item.Value)) { Combo3Items.Add(item); } break; case "SHIFT03ECOMBO4": if (!String.IsNullOrEmpty(item.Value)) { Combo4Items.Add(item); } break; case "SHIFT03ECOMBO5": if (!String.IsNullOrEmpty(item.Value)) { Combo5Items.Add(item); } break; case "SHIFT03ECOMBO6": if (!String.IsNullOrEmpty(item.Value)) { Combo6Items.Add(item); } break; case "SHIFT03ECOMBO7": if (!String.IsNullOrEmpty(item.Value)) { Combo7Items.Add(item); } break; } } Clipart1Configuration = ClipartConfiguration.FromXml(node, "SHIFT03EClipart1"); Clipart2Configuration = ClipartConfiguration.FromXml(node, "SHIFT03EClipart2"); Clipart3Configuration = ClipartConfiguration.FromXml(node, "SHIFT03EClipart3"); CommonEditorConfiguration = TextEditorConfiguration.FromXml(node); HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT03EHeader"); MemoPopup1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03EMULTIBOX1"); MemoPopup2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03EMULTIBOX2"); MemoPopup3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03EMULTIBOX3"); MemoPopup4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03EMULTIBOX4"); MemoPopup5Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03EMULTIBOX5"); MemoPopup6Configuration = TextEditorConfiguration.FromXml(node, "SHIFT03EMULTIBOX6"); ComboConfiguration = TextEditorConfiguration.FromXml(node, "TAB3COMBOS"); } if (resourceManager.DataClientGoalsFile.ExistsLocal()) { var targetMemoPopupLists = new[] { MemoPopup1Items, MemoPopup2Items, MemoPopup3Items, }; var document = new XmlDocument(); document.Load(resourceManager.DataClientGoalsFile.LocalPath); var goalNodes = document.SelectNodes("//ClientGoals/Goal")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }; foreach (var node in goalNodes) { var goalDataItem = ListDataItem.FromXml(node); foreach (var itemList in targetMemoPopupLists) { if (!itemList.Any(item => String.Equals(item.Value, goalDataItem.Value, StringComparison.OrdinalIgnoreCase))) { itemList.Add(ListDataItem.Clone(goalDataItem)); } } } } if (resourceManager.DataApproachesCommonFile.ExistsLocal()) { var targetMemoPopupLists = new[] { MemoPopup4Items, MemoPopup5Items, MemoPopup6Items, }; var document = new XmlDocument(); document.Load(resourceManager.DataApproachesCommonFile.LocalPath); var approachNodes = document.SelectNodes("//OurApproach/Approach/Name")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }; foreach (var node in approachNodes) { foreach (var itemList in targetMemoPopupLists) { if (!itemList.Any(item => String.Equals(item.Value, node.InnerText, StringComparison.OrdinalIgnoreCase))) { itemList.Add(ListDataItem.FromString(node.InnerText)); } } } } if (resourceManager.DataSolutionsCommonFile.ExistsLocal()) { var targetComboItemLists = new[] { Combo1Items, Combo2Items, Combo3Items, Combo4Items, Combo5Items, Combo6Items, Combo7Items, }; var document = new XmlDocument(); document.Load(resourceManager.DataSolutionsCommonFile.LocalPath); var productNodes = document.SelectNodes("//Products/Product/Name")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }; foreach (var node in productNodes) { foreach (var comboItemList in targetComboItemLists) { if (!comboItemList.Any(item => String.Equals(item.Value, node.InnerText, StringComparison.OrdinalIgnoreCase))) { comboItemList.Add(ListDataItem.FromString(node.InnerText)); } } } } }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (resourceManager.DataNeedsCommonFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataNeedsCommonFile.LocalPath); var itemInfoNodes = document.SelectNodes("//SHIFTNeeds/Need")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }; foreach (var itemInfoNode in itemInfoNodes) { NeedsList.Add(NeedsItemInfo.FromXml(itemInfoNode, resourceManager.ClipartTab7SubAFolder)); } } if (resourceManager.DataNeedsSolutionsPartEFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataNeedsSolutionsPartEFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT07E"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT07EHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT07ECombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "SHIFT07ETab1": Tab1DefaultItem = NeedsList.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 "SHIFT07ETab2": Tab2DefaultItem = NeedsList.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 "SHIFT07ETab3": Tab3DefaultItem = NeedsList.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 "SHIFT07ETab4": Tab4DefaultItem = NeedsList.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, "SHIFT07EHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07ECombo1"); SubHeader1Configuration = TextEditorConfiguration.FromXml(node, "Tab1MultiBox"); SubHeader2Configuration = TextEditorConfiguration.FromXml(node, "Tab2MultiBox"); SubHeader3Configuration = TextEditorConfiguration.FromXml(node, "Tab3MultiBox"); SubHeader4Configuration = TextEditorConfiguration.FromXml(node, "Tab4MultiBox"); FormListConfiguration = FormListConfiguration.FromXml(node); } }
public override void LoadData(XmlNode configNode, ResourceManager resourceManager) { base.LoadData(configNode, resourceManager); if (resourceManager.DataSolutionsCommonFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(resourceManager.DataSolutionsCommonFile.LocalPath); var itemInfoNodes = document.SelectNodes("//Products/Product")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }; foreach (var productNode in itemInfoNodes) { var fileName = productNode.SelectSingleNode("./ProductFile")?.InnerText; if (!String.IsNullOrWhiteSpace(fileName)) { var filePath = Path.Combine(Asa.Common.Core.Configuration.ResourceManager.Instance.DictionariesFolder.LocalPath, fileName); if (File.Exists(filePath)) { Products.Add(ProductInfo.FromFile( productNode.SelectSingleNode("./Name")?.InnerText, filePath)); } } } } if (_resourceManager.DataContractPartAFile.ExistsLocal()) { var document = new XmlDocument(); document.Load(_resourceManager.DataContractPartAFile.LocalPath); var node = document.SelectSingleNode(@"/SHIFT15A"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { var item = ListDataItem.FromXml(childNode); switch (childNode.Name) { case "SHIFT15AHeader": if (!String.IsNullOrEmpty(item.Value)) { HeadersItems.Add(item); } break; case "SHIFT15ACombo1": if (!String.IsNullOrEmpty(item.Value)) { Combo1Items.Add(item); } break; case "SHIFT15ACombo2": if (!String.IsNullOrEmpty(item.Value)) { Combo2Items.Add(item); } break; } } TabSelector = TabSelectorConfiguration.FromXml(node, "SHIFT15ATabStrip"); CommonEditorConfiguration = TextEditorConfiguration.FromXml(node); HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT15AHeader"); Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT15ACombo1"); Combo2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT15ACombo2"); var productMemoPopupConfiguration = TextEditorConfiguration.FromXml(node, "ProductMultiBox1"); var productCombo1Configuration = TextEditorConfiguration.FromXml(node, "ProductCombo1"); var productCombo2Configuration = TextEditorConfiguration.FromXml(node, "ProductCombo2"); var productCombo3Configuration = TextEditorConfiguration.FromXml(node, "ProductCombo3"); var productButtonConfiguration = ProductButtonConfiguration.FromXml(node, "ProductButtons"); var productListConfiguration = FormListConfiguration.FromXml(node); foreach (var itemInfo in Products) { itemInfo.MemoPopup1Configuration = productMemoPopupConfiguration; itemInfo.Combo1Configuration = productCombo1Configuration; itemInfo.Combo2Configuration = productCombo2Configuration; itemInfo.Combo3Configuration = productCombo3Configuration; itemInfo.ButtonConfiguration = productButtonConfiguration; itemInfo.FormListConfiguration = productListConfiguration; } } }