public TypeInfoNsTreeNode GetNs(string ns) { TypeInfoNsTreeNode currentNode = GetRoot(); if (String.IsNullOrEmpty(ns)) { return(currentNode); } string[] names = ns.Split('.'); for (int i = 0; i < names.Length; i++) { TypeInfoNsTreeNode node = currentNode._innerList.OfType <TypeInfoNsTreeNode>().FirstOrDefault(n => n.Name == names[i]); if (node != null) { currentNode = node; } else { for (int n = 0; n < names.Length; n++) { currentNode = new TypeInfoNsTreeNode(names[n], currentNode); } } } return(currentNode); }
public TypeInfoCollections(IEnumerable <Assembly> assemblies) { foreach (Assembly a in assemblies) { _byAssembly.Add(new AssemblyTreeNode(a)); } ByNamespace = new TypeInfoNsTreeNode(assemblies); }
public TypeInfoNsTreeNode GetRoot() { TypeInfoNsTreeNode current = this; while (current.Parent != null && current.Parent is TypeInfoNsTreeNode) { current = (TypeInfoNsTreeNode)(current.Parent); } return(current); }
public TypeInfoNsTreeNode(IEnumerable <Assembly> assemblies) { Name = ""; Parent = null; foreach (Type type in assemblies.SelectMany(a => a.GetExportedTypes())) { TypeInfoNsTreeNode node = GetNs(type.Namespace); node._innerList.Add(new TypeInfoTreeNode(type, node)); } }
public TypeInfoNsTreeNode(AssemblyTreeNode parent) { Name = ""; Parent = parent; foreach (Type type in parent.GetAssembly().GetExportedTypes()) { TypeInfoNsTreeNode node = GetNs(type.Namespace); node._innerList.Add(new TypeInfoTreeNode(type, node)); } }
public AssemblyTreeNode(Assembly assembly) { _assembly = assembly; NsRoot = new TypeInfoNsTreeNode(this); }
private TypeInfoNsTreeNode(string name, TypeInfoNsTreeNode parent) { Name = name; Parent = parent; parent._innerList.Add(this); }