Files

56 lines
1.3 KiB
C#
Raw Permalink Normal View History

2026-08-27 10:56:38 -06:00
using System;
using System.Collections.Generic;
using Microsoft.Cci;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Symbols;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Emit;
internal sealed class AssemblyReference : IAssemblyReference, IModuleReference, IUnitReference, IReference, INamedEntity
{
private readonly AssemblySymbol _targetAssembly;
public AssemblyIdentity Identity => _targetAssembly.Identity;
public Version AssemblyVersionPattern => _targetAssembly.AssemblyVersionPattern;
string INamedEntity.Name => Identity.Name;
internal AssemblyReference(AssemblySymbol assemblySymbol)
{
_targetAssembly = assemblySymbol;
}
public override string ToString()
{
return _targetAssembly.ToString();
}
void IReference.Dispatch(MetadataVisitor visitor)
{
visitor.Visit((IAssemblyReference)(object)this);
}
IAssemblyReference IModuleReference.GetContainingAssembly(EmitContext context)
{
return (IAssemblyReference)(object)this;
}
IEnumerable<ICustomAttribute> IReference.GetAttributes(EmitContext context)
{
return SpecializedCollections.EmptyEnumerable<ICustomAttribute>();
}
IDefinition IReference.AsDefinition(EmitContext context)
{
return null;
}
ISymbolInternal IReference.GetInternalSymbol()
{
return null;
}
}