2008-02-27 Chris Toshok <toshok@ximian.com>
[mono.git] / mcs / tools / corcompare / mono-api-info.cs
index f5435e92eb59c8b1950d3248edb33601a493da62..c2ff8a7ca4a1420fe3a4936bd6f5f38ddbbf089b 100644 (file)
@@ -381,13 +381,25 @@ namespace Mono.AssemblyInfo
                        foreach (MemberData md in members)
                                md.DoOutput ();
 
-                       Type [] nested = type.GetNestedTypes ();
+                       Type [] nested = type.GetNestedTypes (BindingFlags.Public | BindingFlags.NonPublic);
                        if (nested != null && nested.Length > 0) {
-                               XmlNode classes = document.CreateElement ("classes", null);
-                               nclass.AppendChild (classes);
+                               bool add_nested = false;
                                foreach (Type t in nested) {
-                                       TypeData td = new TypeData (document, classes, t);
-                                       td.DoOutput ();
+                                       if (t.IsNestedPublic || t.IsNestedFamily || t.IsNestedFamORAssem) {
+                                               add_nested = true;
+                                               break;
+                                       }
+                               }
+
+                               if (add_nested) {
+                                       XmlNode classes = document.CreateElement ("classes", null);
+                                       nclass.AppendChild (classes);
+                                       foreach (Type t in nested) {
+                                               if (t.IsNestedPublic || t.IsNestedFamily || t.IsNestedFamORAssem) {
+                                                       TypeData td = new TypeData (document, classes, t);
+                                                       td.DoOutput ();
+                                               }
+                                       }
                                }
                        }
                }