コード例 #1
0
        public override void LoadData(XmlNode configNode, ResourceManager resourceManager)
        {
            base.LoadData(configNode, resourceManager);

            if (!_resourceManager.DataROIPartEFile.ExistsLocal())
            {
                return;
            }
            var document = new XmlDocument();

            document.Load(_resourceManager.DataROIPartEFile.LocalPath);

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

            if (node == null)
            {
                return;
            }

            foreach (var headerNode in (node.SelectNodes("./SHIFT13EHeader")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { }).ToList())
            {
                HeadersItems.Add(ListDataItem.FromXml(headerNode));
            }

            Tab1 = Tab1Info.FromXml(node);
            Tab2 = Tab2Info.FromXml(node);
            Tab3 = Tab3Info.FromXml(node, _resourceManager);

            CommonEditorConfiguration  = TextEditorConfiguration.FromXml(node);
            HeadersEditorConfiguration = TextEditorConfiguration.FromXml(node, "SHIFT13EHeader");
        }
コード例 #2
0
        public static PositioningInfo FromXml(XmlNode configNode)
        {
            var positioningInfo = Empty();

            positioningInfo.Title = configNode.SelectSingleNode("./Title")?.InnerText ?? positioningInfo.Title;

            foreach (var node in configNode.SelectNodes("./Tabs/Tab")?.OfType <XmlNode>().ToArray() ?? new XmlNode[] { })
            {
                var id = node.Attributes?.OfType <XmlAttribute>()
                         .FirstOrDefault(a => String.Equals(a.Name, "Id", StringComparison.OrdinalIgnoreCase))?.Value?.ToUpper();
                switch (id)
                {
                case "STATEMENTS":
                    positioningInfo.Tab1 = Tab1Info.FromXml(node);
                    break;

                case "BULLETPOINTS":
                    positioningInfo.Tab2 = Tab2Info.FromXml(node);
                    break;
                }
            }
            return(positioningInfo);
        }