Esempio n. 1
0
        public virtual bool Include(ITypeDefinitionMember member)
        {
            // Include internal and private protected members.
            if (member.Visibility == TypeMemberVisibility.Family ||
                member.Visibility == TypeMemberVisibility.FamilyAndAssembly)
            {
                // Similar to special case in PublicOnlyCciFilter, include protected members even of a sealed type.
                // This is necessary to generate compilable code e.g. callers with IVT dependencies on this assembly
                // may call internal methods in a sealed type. (IsVisibleToFriendAssemblies() includes the IsSealed
                // check for other use cases besides this one.)
                return(true);
            }

            // Include public(-ish) members and explicit interface implementations.
            if (member.IsVisibleToFriendAssemblies())
            {
                return(true);
            }

            // If a type is abstract and has an internal or public constructor, it must expose all abstract members.
            var containingType = member.ContainingTypeDefinition;

            if (containingType.IsAbstract &&
                member.IsAbstract() &&
                containingType.IsConstructorVisibleToFriendAssemblies())
            {
                return(true);
            }

            // Otherwise...
            return(false);
        }