Esempio n. 1
0
 private SolutionsItemInfo()
 {
     ClipartConfiguration   = new ClipartConfiguration();
     ButtonConfiguration    = SolutionButtonConfiguration.Empty();
     SubheaderConfiguration = TextEditorConfiguration.Empty();
 }
Esempio n. 2
0
        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 itemInfoNode in itemInfoNodes)
                {
                    SolutionsList.Add(SolutionsItemInfo.FromXml(itemInfoNode, resourceManager.ClipartTab7SubCFolder));
                }
            }

            if (resourceManager.DataNeedsSolutionsPartCFile.ExistsLocal())
            {
                var document = new XmlDocument();
                document.Load(resourceManager.DataNeedsSolutionsPartCFile.LocalPath);

                var node = document.SelectSingleNode(@"/SHIFT07C");
                if (node == null)
                {
                    return;
                }
                foreach (XmlNode childNode in node.ChildNodes)
                {
                    var item = ListDataItem.FromXml(childNode);
                    switch (childNode.Name)
                    {
                    case "SHIFT07CHeader":
                        if (!String.IsNullOrEmpty(item.Value))
                        {
                            HeadersItems.Add(item);
                        }
                        break;

                    case "SHIFT07CCombo1":
                        if (!String.IsNullOrEmpty(item.Value))
                        {
                            Combo1Items.Add(item);
                        }
                        break;
                    }
                }

                TabSelector = TabSelectorConfiguration.FromXml(node, "SHIFT07CTabStrip1");

                CommonEditorConfiguration  = TextEditorConfiguration.FromXml(node);
                HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT07CHeader");
                Combo1Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT07CCombo1");

                foreach (var itemInfo in SolutionsList)
                {
                    itemInfo.ButtonConfiguration =
                        SolutionButtonConfiguration.FromXml(node, String.Format("ProductButton{0}", itemInfo.Id));
                    itemInfo.SubheaderConfiguration =
                        TextEditorConfiguration.FromXml(node, String.Format("ProductButton{0}", itemInfo.Id));
                }
            }
        }