示例#1
0
        private void AddNamespace(XmlElement elem)
        {
            if (elem.Name != "namespace")
                throw new Exception("Wrong element; expected 'namespace'.");

            DefNameSpace spc = new DefNameSpace(elem, _managedNamespace);

            if (spc.NativeName.Contains("::"))
            {
                string pname = spc.NativeName.Substring(0, spc.NativeName.LastIndexOf("::"));
                foreach (DefNameSpace fns in NameSpaces)
                {
                    if (fns.NativeName == pname)
                    {
                        spc.ParentNameSpace = fns;
                        fns.ChildNameSpaces.Add(spc);
                        break;
                    }
                }
            }

            NameSpaces.Add(spc);
        }
示例#2
0
 private void AddAttributesInNamespace(DefNameSpace nameSpace, XmlElement elem)
 {
     foreach (XmlNode child in elem.ChildNodes)
     {
         if (child is XmlElement)
             AddAttributesInType(nameSpace.GetDefType((child as XmlElement).GetAttribute("name")), child as XmlElement);
     }
 }