public override void DoOutput() { if (document == null) { throw new InvalidOperationException("Document not set"); } XmlNode nassembly = document.CreateElement("assembly", null); AssemblyNameDefinition aname = ass.Name; AddAttribute(nassembly, "name", aname.Name); AddAttribute(nassembly, "version", aname.Version.ToString()); parent.AppendChild(nassembly); TypeForwardedToData.OutputForwarders(document, nassembly, ass); AttributeData.OutputAttributes(document, nassembly, ass.CustomAttributes); var typesCollection = ass.MainModule.Types; if (typesCollection == null || typesCollection.Count == 0) { return; } object [] typesArray = new object [typesCollection.Count]; for (int i = 0; i < typesCollection.Count; i++) { typesArray [i] = typesCollection [i]; } Array.Sort(typesArray, TypeReferenceComparer.Default); XmlNode nss = document.CreateElement("namespaces", null); nassembly.AppendChild(nss); string current_namespace = "$%&$&"; XmlNode ns = null; XmlNode classes = null; foreach (TypeDefinition t in typesArray) { if (string.IsNullOrEmpty(t.Namespace)) { continue; } if (!Driver.AbiMode && ((t.Attributes & TypeAttributes.VisibilityMask) != TypeAttributes.Public)) { continue; } if (t.DeclaringType != null) { continue; // enforce !nested } if (t.Namespace != current_namespace) { current_namespace = t.Namespace; ns = document.CreateElement("namespace", null); AddAttribute(ns, "name", current_namespace); nss.AppendChild(ns); classes = document.CreateElement("classes", null); ns.AppendChild(classes); } TypeData bd = new TypeData(document, classes, t); bd.DoOutput(); } }
public static void OutputForwarders (XmlDocument document, XmlNode parent, AssemblyDefinition ass) { TypeForwardedToData tftd = new TypeForwardedToData (document, parent, ass); tftd.DoOutput (); }
public static void OutputForwarders(XmlDocument document, XmlNode parent, AssemblyDefinition ass) { TypeForwardedToData tftd = new TypeForwardedToData(document, parent, ass); tftd.DoOutput(); }