示例#1
0
 public void generatePackageFromXMLNode(EAPackage parentPackage, XmlNode xmlNode)
 {
     foreach (XmlNode n in xmlNode.ChildNodes)
     {
         if (isPackage(n))
         {
             EAPackage package = createEAPackageFromXMLNode(n);
             parentPackage.addPackage(package);
             generatePackageFromXMLNode(package, n);
         }
         else if (isClass(n))
         {
             parentPackage.addClass(createEAClassFromXMLNode(n));
         }
     }
 }
示例#2
0
        private void initPackage(EA.Package topPackage, EAPackage rootPackage)
        {
            foreach (EA.Package p in topPackage.Packages)
            {
                EAPackage newPackage = new EAPackage(p.Name, p.PackageGUID);
                newPackage.EaPackage = p;

                foreach (EA.Element element in p.Elements)
                {
                    EAClass eAClass = new EAClass(element.Name, element.ElementGUID);
                    eAClass.Element = element;
                    foreach (EA.Attribute attribute in element.Attributes)
                    {
                        EAAttribute eAAttribute = new EAAttribute(attribute.Name, attribute.AttributeGUID);
                        eAAttribute.Attribute = attribute;
                        eAClass.addAttribute(eAAttribute);
                    }
                    newPackage.addClass(eAClass);
                }
                rootPackage.addPackage(newPackage);
                initPackage(p, newPackage);
            }
        }