public StatementItemState Clone() { var cloned = new StatementItemState(); cloned.Combo = ListDataItem.Clone(Combo); cloned.MemoPopup = ListDataItem.Clone(MemoPopup); return(cloned); }
public BulletsTabState Clone() { var cloned = new BulletsTabState(); cloned.Toggled = Toggled; cloned.Combo1 = ListDataItem.Clone(Combo1); cloned.Bullets.AddRange(Bullets.Select(ListDataItem.Clone)); return(cloned); }
public ProductItemState Clone() { var clonedItem = new ProductItemState(ProductId); clonedItem.MemoPopup1 = ListDataItem.Clone(MemoPopup1); clonedItem.Combo1 = ListDataItem.Clone(Combo1); clonedItem.Combo2 = ListDataItem.Clone(Combo2); clonedItem.Combo3 = ListDataItem.Clone(Combo3); return(clonedItem); }
public ProductItemState Clone() { var clonedItem = new ProductItemState(ProductId); clonedItem.Header = ListDataItem.Clone(Header); clonedItem.Combo1 = ListDataItem.Clone(Combo1); clonedItem.PositionToggle = PositionToggle.Clone(); clonedItem.ResearchToggle = ResearchToggle.Clone(); clonedItem.StyleToggle = StyleToggle.Clone(); return(clonedItem); }
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)); } } } } }