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.DataApproachPartAFile.ExistsLocal())
            {
                var document = new XmlDocument();
                document.Load(resourceManager.DataApproachPartAFile.LocalPath);

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

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

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

                CommonEditorConfiguration  = TextEditorConfiguration.FromXml(node);
                HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT09AHeader");
                Combo1Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT09ACombo1");

                foreach (var itemInfo in ApproachItems)
                {
                    itemInfo.SubheaderConfiguration = TextEditorConfiguration.FromXml(node, String.Format("Button{0}", itemInfo.Id));
                }
            }
        }
Пример #2
0
        public static ApproachItemInfo FromXml(XmlNode configNode, StorageDirectory imageFolder)
        {
            var itemInfo = new ApproachItemInfo();

            itemInfo.Id    = configNode.SelectSingleNode("./Button")?.InnerText;
            itemInfo.Title = configNode.SelectSingleNode("./Name")?.InnerText;

            var imageFileName = configNode.SelectSingleNode("./StaticImage")?.InnerText;

            if (!String.IsNullOrEmpty(imageFileName))
            {
                itemInfo.ImagePath = Path.Combine(imageFolder.LocalPath, imageFileName);
            }

            itemInfo.SubHeaderDefaultValue = configNode.SelectSingleNode("./DefaultStatement")?.InnerText;

            return(itemInfo);
        }
        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);
            }
        }