예제 #1
0
        private void AddTypeReference(ITypeReference type)
        {
            Contract.Assert(type == type.UnWrap());

            _typeReferences.Add(type);
            IAssemblyReference asmRef = type.GetAssemblyReference();

            if (asmRef != null)
            {
                _assemblyReferences.Add(asmRef);
            }
        }
예제 #2
0
        private void AddTypeReference(ITypeReference type)
        {
            Contract.Assert(type == type.UnWrap());

            if (_typePredicate(type))
            {
                IPropertyDefinition property = GetCurrent <IPropertyDefinition>();
                if (property != null)
                {
                    if (property.IsVisibleOutsideAssembly())
                    {
                        if (property.Getter != null)
                        {
                            _dependencies.Add(new TypeReferenceDependency(type, property.Getter.ResolvedTypeDefinitionMember));
                        }
                        if (property.Setter != null)
                        {
                            _dependencies.Add(new TypeReferenceDependency(type, property.Setter.ResolvedTypeDefinitionMember));
                        }
                    }
                }

                ITypeDefinitionMember member = GetCurrent <ITypeDefinitionMember>();
                if (member != null)
                {
                    if (member.IsVisibleOutsideAssembly())
                    {
                        _dependencies.Add(new TypeReferenceDependency(type, member));
                    }

                    return;
                }

                ITypeDefinition typeDef = GetCurrentType();
                if (typeDef != null)
                {
                    if (typeDef.IsVisibleOutsideAssembly())
                    {
                        _dependencies.Add(new TypeReferenceDependency(type, typeDef));
                    }
                    return;
                }
            }
        }
        private void AddDependency(ITypeReference type)
        {
            type = type.UnWrap();

            // We are not directly interested in generic instances or parameters, they will get broken down into
            // their various pieces from the traversal and that is what we are interested in.
            if (type.IsGenericInstance() || type.IsGenericParameter())
            {
                return;
            }

            // We don't care about WindowsRuntime types
            if (type.IsWindowsRuntimeType())
            {
                return;
            }

            AddGeneralDependency(type);

            // Don't walk the full type for dependencies because a type dependency is only a reference to the type
            // and we will already walk any particular method or field reference from it which is all we need.
        }
예제 #4
0
 public static string DocId(this ITypeReference type)
 {
     type = type.UnWrap();
     return(TypeHelper.GetTypeName(type, NameFormattingOptions.DocumentationId));
 }