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

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