示例#1
0
            public bool AddTypeReference(INamedTypeReference type)
            {
                // TODO: Optionally add all members for interfaces, and add all abstract members for abstract classes
                INamedTypeDefinition typeDef = Util.ResolveTypeThrowing(type);

                IAssembly assembly = TypeHelper.GetDefiningUnit(typeDef) as IAssembly;

                AddAssemblyReference(assembly);

                if (!TypesClosure.ContainsKey(typeDef.InternedKey))
                {
                    TypesClosure.Add(typeDef.InternedKey, typeDef);

                    _workList.Enqueue(typeDef);

                    if (Util.IsDelegateType(typeDef))
                    {
                        foreach (ITypeDefinitionMember member in typeDef.Members)
                        {
                            AddMemberReference(member);
                        }
                    }

                    return(true);
                }

                return(false);
            }
示例#2
0
 public bool ContainsType(INamedTypeDefinition typeDef)
 {
     return(TypesClosure.ContainsKey(typeDef.InternedKey));
 }