private static void HandleClass(string classPackage, MappingElement me, Hashtable classMappings, IEnumerator classElements, MultiMap mm, bool extendz) { while (classElements.MoveNext()) { Element clazz = (Element)classElements.Current; if (!extendz) { ClassMapping cmap = new ClassMapping(classPackage, clazz, me, mm); SupportClass.PutElement(classMappings, cmap.FullyQualifiedName, cmap); SupportClass.PutElement(allMaps, cmap.FullyQualifiedName, cmap); } else { string ex = clazz.Attributes["extends"] == null ? null : clazz.Attributes["extends"].Value; if ((object)ex == null) { throw new MappingException("Missing extends attribute on <" + clazz.LocalName + " name=" + clazz.Attributes["name"].Value + ">"); } int commaIndex = ex.IndexOf(','); if (commaIndex > -1) { //suppress the leading AssemblyName ex = ex.Substring(0, commaIndex).Trim(); } ClassMapping superclass = (ClassMapping)allMaps[ex]; if (superclass == null) { // Haven't seen the superclass yet, so record this and process at the end SubclassMapping orphan = new SubclassMapping(classPackage, me, ex, clazz, mm); children.Add(orphan); } else { ClassMapping subclassMapping = new ClassMapping(classPackage, me, superclass.ClassName, superclass, clazz, mm); superclass.AddSubClass(subclassMapping); SupportClass.PutElement(allMaps, subclassMapping.FullyQualifiedName, subclassMapping); } } } }
private static void HandleClass(string classPackage, MappingElement me, Hashtable classMappings, IEnumerator classElements, MultiMap mm, bool extendz) { while (classElements.MoveNext()) { Element clazz = (Element) classElements.Current; if (!extendz) { ClassMapping cmap = new ClassMapping(classPackage, clazz, me, mm); SupportClass.PutElement(classMappings, cmap.FullyQualifiedName, cmap); SupportClass.PutElement(allMaps, cmap.FullyQualifiedName, cmap); } else { string ex = clazz.Attributes["extends"] == null ? null : clazz.Attributes["extends"].Value; if ((object) ex == null) { throw new MappingException("Missing extends attribute on <" + clazz.LocalName + " name=" + clazz.Attributes["name"].Value + ">"); } int commaIndex = ex.IndexOf(','); if (commaIndex > -1) { //suppress the leading AssemblyName ex = ex.Substring(0, commaIndex).Trim(); } ClassMapping superclass = (ClassMapping) allMaps[ex]; if (superclass == null) { // Haven't seen the superclass yet, so record this and process at the end SubclassMapping orphan = new SubclassMapping(classPackage, me, ex, clazz, mm); children.Add(orphan); } else { ClassMapping subclassMapping = new ClassMapping(classPackage, me, superclass.ClassName, superclass, clazz, mm); superclass.AddSubClass(subclassMapping); SupportClass.PutElement(allMaps, subclassMapping.FullyQualifiedName, subclassMapping); } } } }