Esempio n. 1
0
        private TypeNode GetOrAddNode(Type type)
        {
            TypeNode node;

            if (mType2Node.TryGetValue(type, out node))
            {
                return(node);
            }
            node = new TypeNode();
            mType2Node.Add(type, node);

            foreach (var memberType in Policy.GetInstanceMemberTypes(type))
            {
                var memberNode = GetOrAddNode(memberType);
                memberNode.AddDerivedNode(node);
                node.Related |= memberNode.Related;
            }
            foreach (var superType in Policy.GetInstanceSuperTypes(type))
            {
                node.AddDerivedNode(GetOrAddNode(superType));
            }

            if (node.Related)
            {
                mNewRelatedNodes.Push(node);
            }

            return(node);
        }
Esempio n. 2
0
        private TypeNode GetOrAddNode(Type type)
        {
            TypeNode node;
            if (mType2Node.TryGetValue(type, out node)) return node;
            node = new TypeNode();
            mType2Node.Add(type, node);

            foreach (var memberType in Policy.GetInstanceMemberTypes(type))
            {
                var memberNode = GetOrAddNode(memberType);
                memberNode.AddDerivedNode(node);
                node.Related |= memberNode.Related;
            }
            foreach (var superType in Policy.GetInstanceSuperTypes(type))
            {
                node.AddDerivedNode(GetOrAddNode(superType));
            }

            if (node.Related) mNewRelatedNodes.Push(node);

            return node;
        }