Пример #1
0
        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.DataNeedsSolutionsPartBFile.ExistsLocal())
            {
                var document = new XmlDocument();
                document.Load(resourceManager.DataNeedsSolutionsPartBFile.LocalPath);

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

                    case "SHIFT07BCombo1":
                        if (item.IsPlaceholder)
                        {
                            Combo1Placeholder = item.Value;
                        }
                        break;

                    case "SHIFT07BCombo2":
                        if (item.IsPlaceholder)
                        {
                            Combo2Placeholder = item.Value;
                        }
                        break;

                    case "SHIFT07BCombo3":
                        if (item.IsPlaceholder)
                        {
                            Combo3Placeholder = item.Value;
                        }
                        break;

                    case "SHIFT07BCombo4":
                        if (item.IsPlaceholder)
                        {
                            Combo4Placeholder = item.Value;
                        }
                        break;
                    }
                }

                Clipart1Configuration = ClipartConfiguration.FromXml(node, "SHIFT07BClipart1");
                Clipart2Configuration = ClipartConfiguration.FromXml(node, "SHIFT07BClipart2");
                Clipart3Configuration = ClipartConfiguration.FromXml(node, "SHIFT07BClipart3");

                CommonEditorConfiguration  = TextEditorConfiguration.FromXml(node);
                HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT07BHeader");

                Combo1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07BCombo1");
                Combo2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07BCombo2");
                Combo3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07BCombo3");
                Combo4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07BCombo4");

                SubHeader1Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07BLinkText1");
                SubHeader2Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07BLinkText2");
                SubHeader3Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07BLinkText3");
                SubHeader4Configuration = TextEditorConfiguration.FromXml(node, "SHIFT07BLinkText4");
            }
        }
Пример #2
0
        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);
            }
        }