예제 #1
0
        void CreateTypeTreeNodes(List <TypeDef> types)
        {
            TypeTreeNode parentNode = null;

            foreach (var type in types)
            {
                bool wasLoaded = loadedClassTokens == null ? false : loadedClassTokens.Contains(type.MDToken.Raw);

                TypeTreeNode typeNode;
                if (type.DeclaringType == null)
                {
                    typeNode = modNode.GetOrCreateNonNestedTypeTreeNode(type);
                }
                else
                {
                    if (parentNode == null)
                    {
                        parentNode = DnSpyFileListTreeNode.FindTypeNode(type.DeclaringType);
                    }
                    if (parentNode == null || parentNode.LazyLoading)
                    {
                        break;
                    }
                    typeNode = parentNode.GetOrCreateNestedTypeTreeNode(type);
                }
                Debug.Assert(typeNode != null);

                if (wasLoaded || modifiedTypes.Contains(type.MDToken.Raw))
                {
                    UpdateMemberNodes(typeNode);
                }

                parentNode = typeNode;
            }
        }