NamespaceNode ReadNamespace(string namespaceName) { NamespaceNode ns; if (!namespaceMappings.TryGetValue(namespaceName, out ns)) namespaceMappings.Add(namespaceName, ns = new NamespaceNode(Assembly, namespaceName)); return ns; }
public TypeNode(ITypeDefinition type, NamespaceNode @namespace) { TypeDefinition = type; this.@namespace = @namespace; methods = new List <MethodNode>(); fields = new List <FieldNode>(); nestedTypes = new List <TypeNode>(); baseTypes = new List <TypeNode>(); baseTypeArguments = new List <TypeNode>(); }
NamespaceNode ReadNamespace(string namespaceName) { NamespaceNode ns; if (!namespaceMappings.TryGetValue(namespaceName, out ns)) { namespaceMappings.Add(namespaceName, ns = new NamespaceNode(Assembly, namespaceName)); } return(ns); }
public Relationship GetRelationship(INode node) { Relationship relationship = new Relationship(); if (node == this) { relationship.Relationships.Add(RelationshipType.Same); return(relationship); } if (node is NamespaceNode) { NamespaceNode ns = (NamespaceNode)node; foreach (var type in this.GetAllTypes()) { if (type != null && type.Namespace == ns) { relationship.AddRelationship(RelationshipType.UseThis); } } } if (node is TypeNode) { TypeNode type = (TypeNode)node; foreach (var usedType in this.GetAllTypes()) { if (type == usedType) { relationship.AddRelationship(RelationshipType.UseThis); } } } if (node is FieldNode) { FieldNode field = (FieldNode)node; if (this == field) { relationship.AddRelationship(RelationshipType.UseThis); } } return(relationship); }
TypeNode ReadType(ITypeDefinition type) { if (type == null) { return(null); } TypeNode t; if (typeMappings.TryGetValue(type, out t)) { return(t); } cecilMappings.Add(loader.GetCecilObject(type.Parts[0]), type); NamespaceNode ns = ReadNamespace(type.Namespace); typeMappings.Add(type, t = new TypeNode(type, ns)); ns.types.Add(t); if (type.DeclaringTypeDefinition != null) { ReadType(type.DeclaringTypeDefinition).nestedTypes.Add(t); } return(t); }
public static BitmapSource GetIcon(NamespaceNode ns) { return(NamespaceNode); }
public TypeNode(ITypeDefinition type, NamespaceNode @namespace) { TypeDefinition = type; this.@namespace = @namespace; methods = new List<MethodNode>(); fields = new List<FieldNode>(); nestedTypes = new List<TypeNode>(); baseTypes = new List<TypeNode>(); baseTypeArguments = new List<TypeNode>(); }
public static BitmapSource GetIcon(NamespaceNode ns) { return NamespaceNode; }