Ejemplo n.º 1
0
        bool IAssemblySymbol.GivesAccessTo(IAssemblySymbol assemblyWantingAccess)
        {
            if (Equals(this, assemblyWantingAccess))
            {
                return(true);
            }

            var myKeys = UnderlyingAssemblySymbol.GetInternalsVisibleToPublicKeys(assemblyWantingAccess.Name);

            if (myKeys.Any())
            {
                // We have an easy out here. Suppose the assembly wanting access is
                // being compiled as a module. You can only strong-name an assembly. So we are going to optimistically
                // assume that it is going to be compiled into an assembly with a matching strong name, if necessary.
                if (assemblyWantingAccess.IsNetModule())
                {
                    return(true);
                }

                AssemblyIdentity identity = UnderlyingAssemblySymbol.Identity;

                foreach (var key in myKeys)
                {
                    IVTConclusion conclusion = identity.PerformIVTCheck(assemblyWantingAccess.Identity.PublicKey, key);
                    Debug.Assert(conclusion != IVTConclusion.NoRelationshipClaimed);
                    if (conclusion == IVTConclusion.Match || conclusion == IVTConclusion.OneSignedOneNot)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
 ImmutableArray <INamedTypeSymbol> IAssemblySymbol.GetForwardedTypes()
 {
     return(UnderlyingAssemblySymbol
            .GetAllTopLevelForwardedTypes()
            .Select(t => t.GetPublicSymbol())
            .OrderBy(t => t.ToDisplayString(SymbolDisplayFormat.QualifiedNameArityFormat))
            .AsImmutable());
 }
Ejemplo n.º 3
0
 INamedTypeSymbol IAssemblySymbol.ResolveForwardedType(string fullyQualifiedMetadataName)
 {
     return(UnderlyingAssemblySymbol.ResolveForwardedType(fullyQualifiedMetadataName).GetPublicSymbol());
 }
Ejemplo n.º 4
0
 AssemblyMetadata IAssemblySymbol.GetMetadata() => UnderlyingAssemblySymbol.GetMetadata();
Ejemplo n.º 5
0
 INamedTypeSymbol IAssemblySymbol.GetTypeByMetadataName(string metadataName)
 {
     return(UnderlyingAssemblySymbol.GetTypeByMetadataName(metadataName).GetPublicSymbol());
 }