[csdoc-patches] csdoc/src/mcsdoc/MCSDoc AttributeDoc.cs,NONE,1.1 ChangeLog,NONE,1.1 ClassDoc.cs,NONE
Status: Planning
Brought to you by:
mastergaurav
From: <mas...@us...> - 2004-10-30 14:26:34
|
Update of /cvsroot/csdoc/csdoc/src/mcsdoc/MCSDoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14455 Added Files: AttributeDoc.cs ChangeLog ClassDoc.cs ClassDocList.cs DocTreeGenerator.cs IAttributeDoc.cs IClassDoc.cs IContainerDoc.cs IInterfaceDoc.cs INamespaceDoc.cs IRootDoc.cs IStructDoc.cs NamespaceDoc.cs RootDoc.cs Log Message: 2004-10-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * **.cs : Moving from ../../mcs/MCSDoc directory to here. --- NEW FILE: AttributeDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: AttributeDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; using System; namespace MCSDoc { internal class AttributeDoc : ClassDoc, IAttributeDoc { private AccessFlags flags; private AttributeTargets targets; public AttributeDoc(Class klass) : base(klass) { if(!base.IsAttribute) throw new Exception("[AttributeDoc] Class is not an attribute"); } public AccessFlags Flags { get { throw new NotImplementedException() } } public AttributeTargets Targets { get { throw new NotImplementedException() } } } } --- NEW FILE: ChangeLog --- * $Id: ChangeLog,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ 2004-10-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * **.cs : Moving from ../../mcs/MCSDoc directory to here. 2003-04-06 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * ClassDoc.cs : Checking for exception and attribute. Ummm! Looks clumsy. Will rectify it later. 2003-04-02 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * DocTreeGenerator.cs : ParseAndGenerate() - No need for multiple calls here itself. : GenerateTree() - Lot of work. * NamespaceDoc.cs : No need for subnamespaces. * ClassDoc.cs : Implements IComparable. Need while sorting the array. 2003-04-01 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * NamespaceDoc.cs : Name { get; } - Added, CreateHierarchy(ArrayList) - Init impl, IsNamespaceAdded(string, ArrayList), IsNamespaceAdded(string, NamespaceDoc), GetSubnames(string) - Added. 2003-04-01 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * INamespaceDoc.cs : Namespaces { get; } - Sub-namespaces. * DocTreeGenerator.cs : Parsing done. Generation to start. * NamespaceDoc.cs : CreateHierarchy(ArrayList) - Stubbed. 2003-04-01 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * AttributeDoc.cs : Oops! Forgot to add last time. * RootDoc.cs : Don't parse here. * DocTreeGenerator.cs : Making it come to use. 2003-03-28 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * RootDoc.cs : Populated all. Will take a second look sometime later, especially for PopulateInners. Have to take of if class is an attribute. * AttributeDoc.cs : Initial implementation * ClassDoc.cs : Class { get; } - Added. : Accessibility - internal. 2003-03-28 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * ClassDoc.cs : Parse() - Some impl. * RootDoc.cs : PopulateTypeContainers - Init Impl. * NamespaceDoc.cs : Initial implementation. * INamespaceDoc.cs : No Attributes to a namespace. Ok! * IAttributeDoc.cs, * IInterfaceDoc.cs, * IContainerDoc.cs : Name { get; } - Added. * IAttributeDoc.cs : Now derives from IContainerDoc 2003-03-28 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * RootDoc.cs : Stubbed PopulateXXXX methods * DocTreeGenerator.cs : Looks like won't need it in future 2003-03-27 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * RootDoc.cs : Initial implementation. * ClassDoc.cs : Initial implementation. * DocTreeGenerator.cs : Going ahead and back and ahead. * IContainerDoc.cs : IContainerDoc made property. * IRootDoc.cs : Namespaces is INamespace[] 2003-03-22 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * DocTreeGenerator.cs : Stubbed RootDoc { get; } 2003-03-22 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * IAttributeDoc.cs, * IInterfaceDoc.cs : Added interfaces * ClassDoc.cs : Initial implementation * DocTreeGenerator.cs : Initial implementation 2003-03-09 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * IRootDoc.cs, * IClassDoc.cs, * INamespaceDoc.cs : Don't use *List classes. * ClassDocList.cs : Will remove it later. * IContainerDoc.cs : Superinterfaces for IClassDoc, IStructDoc since both of them can hold all other types inside them. * IStructDoc.cs : Added interface. 2003-03-08 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * IRootDoc.cs, * IClassDoc.cs, * INamespaceDoc.cs, * ClassDocList.cs : Trying to see what works best. Still not sure of what classes to have and what properties will they have. 2003-02-25 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * RootDoc.cs : Removed * IRootDoc.cs : Added interface * ClassDocList.cs : List of IClassDoc 2003-02-25 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * RootDoc.cs : Initial implementaion. --- NEW FILE: ClassDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: ClassDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using System; using System.Collections; using Mono.CSharp; namespace MCSDoc { internal class ClassDoc : IClassDoc, IComparable { private Class klass; private string name; private bool isException = false; private bool isAttribute = false; private IClassDoc baseClass = null; private IInterfaceDoc[] interfaces = null; private IContainerDoc container = null; public ClassDoc(Class klass) { this.klass = klass; // need to Set - BaseClass, Interfaces, Container throw new NotImplementedException(); } private void Parse() { /* ArrayList bases = klass.Bases; if(bases != null || bases.Count > 0) { // } */ if(klass.BaseType != null) { isAttribute = IsSubtypeOf(TypeManager.attribute_type); isException = IsSubtypeOf(TypeManager.exception_type); } } private bool IsSubtypeOf(Type type) { Type baseType = klass.BaseType; while(baseType != null && baseType.ToString() != type.ToString()) { if(baseType.IsSubclassOf(type)) return true; baseType = baseType.BaseType; } return false; } protected Class Class { get { return this.klass; } } public string NamespaceName { get { throw new NotImplementedException(); } } public string Name { get { return name; } } public bool IsContained { get { return this.container != null; } } public bool IsException { get { return isException; } } public bool IsAttribute { get { return isAttribute; } } public IClassDoc BaseClass { get { return baseClass; } } public IInterfaceDoc[] Interfaces { get { return interfaces; } } public IContainerDoc Container { get { return this.container; } } public int CompareTo(object obj) { if(obj is ClassDoc) { ClassDoc other = (ClassDoc) obj; string otherName = other.Name; if(other.NamespaceName == this.NamespaceName) { return (this.Name.CompareTo(other.Name)); } // I know this is wrong. return NamespaceName.CompareTo(other.NamespaceName); } throw new ArgumentException("[CompareTo] obj is not of" + " type ClassDoc"); } } } --- NEW FILE: ClassDocList.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: ClassDocList.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; using System.Collections; namespace MCSDoc { public class ClassDocList : IEnumerator { private ArrayList classDocs = new ArrayList(); public ClassDocList() { } public ClassDocList(ArrayList classDocs) { if(classDocs != null) { foreach(object c in classDocs) { if(c is IClassDoc) Add((IClassDoc)c); } } } public IClassDoc this[int index] { get { if(index >= 0 && index < classDocc.Count) { return (IClassDoc)classDocs[index]; } } set { classDocs[index] = value; } } public int Count { get { return classDocs.Count; } } public void Add(IClassDoc classDoc) { classDocs.Add(classDoc); } public bool Contains(IClassDoc classDoc) { return classDocs.Contains(classDoc); } public Enumerator GetEnumerator() { return classDocs.GetEnumerator(); } } } --- NEW FILE: DocTreeGenerator.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: DocTreeGenerator.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; using System; using System.Collections; namespace MCSDoc { internal class DocTreeGenerator { private TypeContainer root = null; private RootDoc rootDoc = null; private ArrayList allNamespaces = new ArrayList(); private ArrayList allClasses = new ArrayList(); private ArrayList allStructs = new ArrayList(); private ArrayList allDelegates = new ArrayList(); private ArrayList allEnums = new ArrayList(); private ArrayList allInterfaces = new ArrayList(); public DocTreeGenerator(TypeContainer root) { if(root == null) { throw new ArgumentException("[DocTreeGenerator] Null root"); } this.root = root; //rootDoc = new RootDoc(root); ParseAndGenerate(); } private void ParseAndGenerate() { //rootDoc.Parse(root); //ParseContainers(root.Types); //ParseDelegates(root.Delegates); //ParseEnums(root.Enums); //ParseInterfaces(root.Interfaces); ParseCotnainer(root); //First need to populate [allNamespaces] //or should I populate while generating tree? ParseNamespaces(); GenerateTree(); } private void GenerateTree() { rootDoc = new RootDoc(); //Need to add ONLY namespaces and all types //that are not inside any namespace. //Namespaces will recursively contain all the //types that are within any namespace. //Now, I will go home today and work on the //exact logic for whole of this system! throw new NotImplementedException(); } private void ParseNamespaces() { foreach(ClassDoc cd in this.allClasses) { if(cd.Namespace.Name != null) { OptNamespaceAdd(cd.Namespace.Name); } } foreach(StructDoc sd in this.allStructs) { if(sd.Namespace.Name != null) { OptNamespaceAdd(sd.Namespace.Name); } } foreach(EnumDoc ed in this.allEnums) { if(ed.Namespace.Name != null) { OptNamespaceAdd(ed.Namespace.Name); } } foreach(InterfaceDoc id in this.allInterfaces) { if(id.Namespace.Name != null) { OptNamespaceAdd(id.Namespace.Name); } } foreach(DelegateDoc dd in this.allDelegates) { if(dd.Namespace.Name != null) { OptNamespaceAdd(dd.Namespace.Name); } } } private void OptNamespaceAdd(string name) { foreach(NamespaceDoc current in allNamespaces) { if(current.Name == name) { return; } } NamespaceDoc nsd = new NamespaceDoc(name); allNamespaces.Add(nsd); } private void HandleNamespaceClass(Class klass, ClassDoc doc) { NamespaceDoc nsd = NamespaceLookup(klass.Namespace.Name); nsd.AddClassDoc(doc); } private void HandleNamespaceStruct(Struct esstruct, StructDoc doc) { NamespaceDoc nsd = NamespaceLookup(esstruct.Namespace.Name); nsd.AddStructDoc(doc); } private void HandleNamespaceEnum(Mono.CSharp.Enum eenum, Mono.CSharp.Enum doc) { NamespaceDoc nsd = NamespaceLookup(eenum.Namespace.Name); allNamespaces.AddClassDoc(doc); } private void HandleNamespaceStruct(Struct esstruct, StructDoc doc) { NamespaceDoc nsd = NamespaceLookup(esstruct.Namespace.Name); nsd.AddStructDoc(doc); } private void ParseContainers(ArrayList containers) { if(containers != null && containers.Count > 0) { foreach(TypeContainer tc in containers) { ParseContainer(tc); } } } private void ParseContainer(TypeContainer container) { if(containers != null) { if(container is Class) { Class c = (Class) container; ClassDoc cd = null; // Is there any better way, since // [c.BaseType != typeof(System.Attribute)] if(c.BaseType.ToString() == "System.Attribute") { cd = new AttributeDoc(c); } else { cd = new ClassDoc(c); } allClasses.Add(cd); } else if(container is Struct) { Struct s = (Struct) container; sd = new StructDoc(s); allStructs.Add(sd); } //Handle all inner types recursively ParseContainers(container.Types); ParseDelegates(container.Delegates); ParseEnums(container.Enums); ParseInterfaces(container.Interfaces); } } private void ParseDelegates(ArrayList delegates) { if(delegates != null && delegates.Count > 0) { foreach(Mono.CSharp.Delegate deleg in delegates) { DelegateDoc dd = new DelegateDoc(deleg); allDelegates.Add(dd); } } } private void ParseEnums(ArrayList enums) { if(enums != null && enums.Count > 0) { foreach(Mono.CSharp.Enum eenum in enums) { EnumDoc ed = new EnumDoc(eenum); allDelegates.Add(ed); } } } private void ParseInterfaces(ArrayList interfaces) { if(interfaces != null && interfaces.Count > 0) { foreach(Interface interf in interfaces) { InterfaceDoc id = new InterfaceDoc(interf); allInterfaces.Add(id); } } } public IRootDoc RootDoc { get { return rootDoc; } } } } --- NEW FILE: IAttributeDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: IAttributeDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; using System; namespace MCSDoc { public interface IAttributeDoc : IClassDoc { AccessFlags Flags { get; } AttributeTargets Targets { get; } } } --- NEW FILE: IClassDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: IClassDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; namespace MCSDoc { public interface IClassDoc : IContainerDoc { bool IsException { get; } bool IsAttribute { get; } /// <summary> /// Returns document element for the /// base class, if any. /// </summary> IClassDoc BaseClass { get; } /// <summary> /// Returns document elements for the /// implemented interfaces, if any. /// </summary> IInterfaceDoc[] Interfaces { get; } } } --- NEW FILE: IContainerDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: IContainerDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; namespace MCSDoc { public interface IContainerDoc { string Comments { get; } string Name { get; } AccessFlags Flags { get; } bool IsContained { get; } // Returns non null only if(IsContained) // may throw an exception otherwise IContainerDoc ContainerDoc { get; } IAttributeDoc[] Attributes { get; } IMethodDoc[] Methods { get; } IPropertyDoc[] Properties { get; } IMemberDoc[] Members { get; } IClassDoc[] InnerClasses { get; } IDelegateDoc[] InnerDelegates { get; } IEnumDoc[] InnerEnums { get; } IInterfaceDoc[] InnerInterfaces { get; } IStructDoc[] InnerStructs { get; } } } --- NEW FILE: IInterfaceDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: IInterfaceDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; namespace MCSDoc { public interface IInterfaceDoc { string Comments { get; } string Name { get; } AccessFlags Flags { get; } IAttributeDoc[] Attributes { get; } IMethodDoc[] Methods { get; } IPropertyDoc[] Properties { get; } IMemberDoc[] Members { get; } IInterfaceDoc[] BaseInterfaces { get; } } } --- NEW FILE: INamespaceDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: INamespaceDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; namespace MCSDoc { public interface INamespaceDoc { string Comments { get; } string Name { get; } INamespaceDoc[] Namespaces { get; } IClassDoc[] Classes { get; } IDelegateDoc[] Delegates { get; } IEnumDoc[] Enums { get; } IInterfaceDoc[] Interfaces { get; } IStructDoc[] Structs { get; } } } --- NEW FILE: IRootDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: IRootDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; namespace MCSDoc { public interface IRootDoc { INamespaceDoc[] Namespaces { get; } IClassDoc[] Classes { get; } IDelegateDoc[] Delegates { get; } IEnumDoc[] Enums { get; } IInterfaceDoc[] Interfaces { get; } IStructDoc[] Structs { get; } } } --- NEW FILE: IStructDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: IStructDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using Mono.CSharp; namespace MCSDoc { public interface IStructDoc : IContainerDoc { } } --- NEW FILE: NamespaceDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: NamespaceDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using System; using System.Collections; using Mono.CSharp; namespace MCSDoc { internal class NamespaceDoc : INamespaceDoc { private string comments; private string name; ArrayList classes = new ArrayList(); ArrayList structs = new ArrayList(); ArrayList delegates = new ArrayList(); ArrayList enums = new ArrayList(); ArrayList interfaces = new ArrayList(); public NamespaceDoc(string name) { this.name = name; } public NamespaceDoc(string name, string filename) : this(name) { throw new NotImplementedException(); } /// <summary> /// Will create a hierarchy of NamespaceDoc elements. /// </summary> /// <remarks> /// btw, do I really need this scrap funda of Parent namespace /// and sub-namespaces? /// </remarks> public static ArrayList CreateHierarchy(ArrayList namespaceDocs) { ArrayList retVal = new ArrayList(); string name; string[] subNames; if(namespaceDocs != null && namespaceDocs.Count > 0) { foreach(NamespaceDoc nd in namespaces) { name = nd.Name; bool isAdded = IsNamespaceAdded(name, retVal); /* if(!isAdded) { subNames = GetSubnames(name); if(subNames != null) { foreach(string subName in subNames) { isAdded &= IsNamespaceAdded(subName, retVal); if(isAdded) break; } } } */ AddNamespaceInHierarchy(nd, retVal); throw new NotImplementedException(); } throw new NotImplementedException(); } } private static void AddNamespaceInHierarchy(NamespaceDoc doc, ArrayList docList) { throw new NotImplementedException(); } private static bool IsNamespaceAdded(string name, ArrayList namespaces) { foreach(NamespaceDoc nsd in namespaces) { if(IsNamespaceAdded(name, nsd) return true; } return false; } private static bool IsNamespaceAdded(string name, NamespaceDoc doc) { throw new NotImplementedException(); } private static string[] GetSubnames(string name) { int dotCount = 0; foreach(char c in name) { if(c == '.') dotCount++; } if(dotCount == 0) return null; int[] dotIndices = new int[dotCount]; int cIndex = 0; int cPos = 0; for(cPos = 0; cPos < name.Length; cPos++) { if(name[cPos] == '.') dotIndices[cIndex++] = cPos; } string retVal[] = new string[dotCount]; for(cIndex = 0; cIndex < dotCount; cIndex++) { retVal[cIndex] = name.Substring(0, dotIndices[cIndex] - 1); } return retVal; } public void AddClassDoc(IClassDoc doc) { classes.Add(doc); } public void AddStructDoc(IStructDoc doc) { structs.Add(doc); } public void SetDelegateDoc(IDelegateDoc doc) { delegates.Add(doc); } public void SetEnumDoc(IEnumDoc doc) { enums.Add(doc); } public void AddInterfaceDoc(IInterfaceDoc doc) { interfaces.Add(doc); } public string Name { get { return this.name; } } public string Comments { get { return comments; } } public IClassDoc[] Classes { get { return (IClassDoc[]) classes.ToArray(typeof(IClassDoc)); } } public IDelegateDoc[] Delegates { get { return (IDelegateDoc[]) delegates.ToArray(typeof(IDelegateDoc)); } } public IEnumDoc[] Enums { get { return (IEnumDoc[]) enums.ToArray(typeof(IEnumDoc)); } } public IInterfaceDoc[] Interfaces { get { return (IInterfaceDoc[]) interfaces.ToArray(typeof(IInterfaceDoc)); } } public IStructDoc[] Structs { get { return (IStructDoc[]) interfaces.ToArray(typeof(IStructDoc)); } } } } --- NEW FILE: RootDoc.cs --- /** * Project: Master C# Document Generator * Contact: mas...@us... * Web: http://csdoc.sourceforge.net * * $Id: RootDoc.cs,v 1.1 2004/10/30 14:26:14 mastergaurav Exp $ * Copyright: (C) 2003, Gaurav Vaish * */ using System; using System.Collections; using Mono.CSharp; namespace MCSDoc { internal class RootDoc : IRootDoc { INamespaceDoc[] namespaces = null; IClassDoc[] classes = null; IStructDoc[] structs = null; IDelegateDoc[] delegates = null; IEnumDoc[] enums = null; IInterfaceDoc[] interfaces = null; ArrayList namespaceList = new ArrayList(); public RootDoc(TypeContainer root) { //Parse(root); } public RootDoc() { //Do nothing! } private void Parse(TypeContainer root) { PopulateContainers(root.Types); throw new NotImplementedException(); } private void PopulateNamespaces() { if(namespaceList.Count > 0) { //namespaces = (INamespaceDoc[]) namespaceList.ToArray(typeof(INamespaceDoc)); } } private void PopulateContainers(ArrayList containers) { if(containers != null || containers.Count > 0) { ArrayList classes = new ArrayList(); ArrayList structs = new ArrayList(); foreach(TypeContainer tc in containers) { if(tc is Class) { Class c = (Class)tc; ClassDoc cd = null; if(c.BaseType != null) { if(c.BaseType.ToString() == "System.Attribute") { cd = new AttributeDoc(c); } } else { cd = new ClassDoc(c); } if(c.Namespace != null && c.Namespace.Name.Length > 0) { HandleNamespaceClass(c, cd); } // process ClassDoc classes.Add(cd); } else if(tc is Struct) { Struct s = (Struct)tc; StructDoc sd = new StructDoc(s); if(s.Namespace != null && s.Namespace.Name.Length > 0) { HandleNamespaceStruct(s, sd); } // process StructDoc structs.Add(sd); } PopulateInners(tc.Types); } if(classes.Count > 0) { this.classes = (IClassDoc[]) classes.ToArray(typeof(IClassDoc)); } if(structs.Count > 0) { this.structs = (IClassDoc[]) classes.ToArray(typeof(IStructDoc)); } } } private NamespaceDoc NamespaceLookup(string name) { NamespaceDoc retVal = null; foreach(NamespaceDoc current in namespaceList) { if(current.Name == name) { return retVal = current; break; } } if(retVal == null) { retVal = new NamespaceDoc(name); namespaceList.Add(nsd); } return retVal; } private void HandleNamespaceClass(Class klass, ClassDoc doc) { NamespaceDoc nsd = NamespaceLookup(klass.Namespace.Name); nsd.AddClassDoc(doc); } private void HandleNamespaceStruct(Struct esstruct, StructDoc doc) { NamespaceDoc nsd = NamespaceLookup(esstruct.Namespace.Name); nsd.AddStructDoc(doc); } private void PopulateInners(ArrayList types) { throw new NotImplementedException(); } private void PopulateEnums(ArrayList enums) { if(enums != null && enums.Count > 0) { ArrayList enumDocs = new ArrayList(); EnumDoc doc; foreach(Mono.CSharp.Enum current in enums) { doc = new EnumDoc(current); enumDocs.Add(doc); } if(enumDocs.Count > 0) { this.enums = (IEnumDoc[]) enumDocs.ToArray(typeof(IEnumDoc)); } } } private void PopulateDelegates(ArrayList delegates) { if(delegates != null && delegates.Count > 0) { ArrayList delegateDocs = new ArrayList(); DelegateDoc doc; foreach(Delegate current in delegates) { doc = new DelegateDoc(current); delegateDocs.Add(doc); } if(delegateDocs.Count > 0) { this.delegates = (IDelegateDoc[]) enumDocs.ToArray(typeof(IDelegateDoc)); } } } private void PopulateInterfaces(ArrayList interfaces) { if(interfaces != null && interfaces.Count > 0) { ArrayList interfaceDocs = new ArrayList(); InterfaceDoc doc; foreach(Interface current in interfaces) { doc = new DelegateDoc(current); interfaceDocs.Add(doc); } if(interfaceDocs.Count > 0) { this.interfaces = (IInterfaceDoc[]) enumDocs.ToArray(typeof(IInterfaceDoc)); } } } } } |