예제 #1
0
		NamespaceNode ReadNamespace(string namespaceName)
		{
			NamespaceNode ns;
			if (!namespaceMappings.TryGetValue(namespaceName, out ns))
				namespaceMappings.Add(namespaceName, ns = new NamespaceNode(Assembly, namespaceName));
			return ns;
		}
예제 #2
0
 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>();
 }
예제 #3
0
        NamespaceNode ReadNamespace(string namespaceName)
        {
            NamespaceNode ns;

            if (!namespaceMappings.TryGetValue(namespaceName, out ns))
            {
                namespaceMappings.Add(namespaceName, ns = new NamespaceNode(Assembly, namespaceName));
            }
            return(ns);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
 public static BitmapSource GetIcon(NamespaceNode ns)
 {
     return(NamespaceNode);
 }
예제 #7
0
		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>();
		}
예제 #8
0
		public static BitmapSource GetIcon(NamespaceNode ns)
		{
			return NamespaceNode;
		}