Example #1
0
        private void LoadPackages(List <PdmPackage> packages, XmlNode packageRootNode, PdmPackage parent)
        {
            if (packageRootNode == null)
            {
                return;
            }

            foreach (XmlNode child in packageRootNode.SelectNodes("o:Package", nms))
            {
                var nameNode    = child.SelectSingleNode("a:Name", nms);
                var packageNode = child.SelectSingleNode("c:Packages", nms);
                var diagramNode = child.SelectSingleNode("c:PhysicalDiagrams", nms);

                var package = new PdmPackage();
                package.Id     = child.Attributes["Id"].InnerText;
                package.Name   = nameNode.InnerText;
                package.Parent = parent;
                packages.Add(package);

                LoadPackages(package.Packages, packageNode, package);
                LoadDiagrams(package.Diagrams, diagramNode, package);
            }
        }
Example #2
0
        private void LoadDiagrams(List <PdmDiagram> diagrams, XmlNode diagramRootNode, PdmPackage parent)
        {
            if (diagramRootNode == null)
            {
                return;
            }

            foreach (XmlNode child in diagramRootNode.SelectNodes("o:PhysicalDiagram", nms))
            {
                var nameNode       = child.SelectSingleNode("a:Name", nms);
                var id             = child.Attributes["Id"].InnerText;
                var symbolRootNode = child.SelectSingleNode("c:Symbols", nms);

                var diagram = new PdmDiagram();
                diagram.Id     = child.Attributes["Id"].InnerText;
                diagram.Name   = nameNode.InnerText;
                diagram.Parent = parent;
                LoadTables(diagram, symbolRootNode);
                diagrams.Add(diagram);
            }
        }