Example #1
0
        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.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));
                            }
                        }
                    }
                }
            }
        }
Example #5
0
        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");
        }
Example #6
0
        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));
                        }
                    }
                }
            }
        }
Example #8
0
        public override void LoadData(XmlNode configNode, ResourceManager resourceManager)
        {
            base.LoadData(configNode, resourceManager);

            if (!resourceManager.DataMarketPartEFile.ExistsLocal())
            {
                return;
            }

            var document = new XmlDocument();

            document.Load(resourceManager.DataMarketPartEFile.LocalPath);

            var node = document.SelectSingleNode(@"/SHIFT05E");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                case "SHIFT05ESubheader1":
                    SubHeader1DefaultValue = Decimal.Parse((item.Value ?? "0").Replace(CultureInfo.CurrentCulture.NumberFormat.PercentSymbol, String.Empty),
                                                           NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands);
                    break;

                case "SHIFT05ESubheader2":
                    if (item.IsPlaceholder)
                    {
                        SubHeader2Placeholder = item.Value;
                    }
                    else
                    {
                        SubHeader2DefaultValue = item.Value;
                    }
                    break;

                case "SHIFT05ESubheader3":
                    SubHeader3DefaultValue = Decimal.Parse((item.Value ?? "0").Replace(CultureInfo.CurrentCulture.NumberFormat.PercentSymbol, String.Empty),
                                                           NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands);
                    break;

                case "SHIFT05ESubheader4":
                    SubHeader4DefaultValue = Decimal.Parse((item.Value ?? "0").Replace(CultureInfo.CurrentCulture.NumberFormat.PercentSymbol, String.Empty),
                                                           NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands);
                    break;

                case "SHIFT05ESubheader5":
                    SubHeader5DefaultValue = Decimal.Parse((item.Value ?? "0").Replace(CultureInfo.CurrentCulture.NumberFormat.PercentSymbol, String.Empty),
                                                           NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands);
                    break;
                }
            }

            Clipart1Configuration = ClipartConfiguration.FromXml(node, "SHIFT05EClipart1");
            Clipart2Configuration = ClipartConfiguration.FromXml(node, "SHIFT05EClipart2");

            CommonEditorConfiguration  = TextEditorConfiguration.FromXml(node);
            HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT05EHeader");
            Combo1Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo1");
            Combo2Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo2");
            Combo3Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo3");
            Combo4Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo4");
            Combo5Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo5");
            Combo6Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo6");
            Combo7Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo7");
            Combo8Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo8");
            Combo9Configuration        = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo9");
            Combo10Configuration       = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo10");
            Combo11Configuration       = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo11");
            Combo12Configuration       = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo12");
            Combo13Configuration       = TextEditorConfiguration.FromXml(node, "SHIFT05ECombo13");
            SubHeader1Configuration    = TextEditorConfiguration.FromXml(node, "SHIFT05ESubheader1");
            SubHeader2Configuration    = TextEditorConfiguration.FromXml(node, "SHIFT05ESubheader2");
            SubHeader3Configuration    = TextEditorConfiguration.FromXml(node, "SHIFT05ESubheader3");
            SubHeader4Configuration    = TextEditorConfiguration.FromXml(node, "SHIFT05ESubheader4");
            SubHeader5Configuration    = TextEditorConfiguration.FromXml(node, "SHIFT05ESubheader5");
        }