internal void AddChild(DocumentedNamespaceTree child) { if (child.SetParent(this)) { _children.Add(child); } }
internal void AddChild(DocumentedNamespaceTree child) { if (child.SetParent(this)) { Children.Add(child); } }
internal bool SetParent(DocumentedNamespaceTree parent) { if (_parent != null) { return(false); } _parent = parent; return(true); }
internal bool SetParent(DocumentedNamespaceTree parent) { if (Parent != null) { return false; } Parent = parent; return true; }
/// <summary> /// Generates a document model from a <see cref="ReflectionModel"/> /// and a <see cref="XmlDocumentationModel"/>. /// </summary> /// <param name="reflectionModel">The reflection model.</param> /// <param name="xmlModel">The XML documentation model.</param> /// <returns>A document model.</returns> public static DocumentModel Map(ReflectionModel reflectionModel, XmlDocumentationModel xmlModel) { var assemblies = new List <DocumentedAssembly>(); // Iterate all assemblies. foreach (var assembly in reflectionModel.Assemblies) { assemblies.Add(MapAssembly(assembly, xmlModel)); } // Create the document model. var model = new DocumentModel(assemblies); // Map extension methods. var finder = new ExtensionMethodFinder(model); var namespaces = model.Assemblies.SelectMany(a => a.Namespaces).ToArray(); foreach (var @namespace in namespaces) { foreach (var type in @namespace.Types) { type.SetExtensionMethods(finder.FindExtensionMethods(type)); } } // Map base types methods. var baseTypeFinder = new BaseTypeFinder(model); foreach (var @namespace in namespaces) { foreach (var type in @namespace.Types) { type.BaseType = baseTypeFinder.FindBaseType(type); } } // Build namespace trees and map them. var trees = DocumentedNamespaceTree.Build(namespaces); foreach (var @namespace in namespaces) { if (trees.ContainsKey(@namespace.Identity)) { @namespace.Tree = trees[@namespace.Identity]; } } return(model); }