in src/Refasmer/Importer/ImportLogic.cs [410:439]
public bool IsInternalsVisible() =>
_reader.IsAssembly && _reader.GetAssemblyDefinition().GetCustomAttributes()
.Select(_reader.GetCustomAttribute)
.Select(_reader.GetCustomAttrClass)
.Select(_reader.GetFullname)
.Any(name => name == FullNames.InternalsVisibleTo);
public bool IsReferenceAssembly() =>
_reader.IsAssembly && _reader.GetAssemblyDefinition().GetCustomAttributes()
.Select(_reader.GetCustomAttribute)
.Select(_reader.GetCustomAttrClass)
.Select(_reader.GetFullname)
.Any(name => name == FullNames.ReferenceAssembly);
private ImmutableHashSet<MethodDefinitionHandle> GetAllowlistedInterfaceMethodImplementations(
TypeDefinition type)
{
return GetImplementations().ToImmutableHashSet();
IEnumerable<MethodDefinitionHandle> GetImplementations()
{
var implementations = type.GetMethodImplementations()
.Select(_reader.GetMethodImplementation);
foreach (var mi in implementations)
{
if (AllowImportType(_reader.GetMethodClass(mi.MethodDeclaration)))
yield return (MethodDefinitionHandle)mi.MethodBody;
}
}
}