4 instantiations of UsedNamespaceOrType
Microsoft.CodeAnalysis (4)
PEWriter\UsedNamespaceOrType.cs (4)
39return new UsedNamespaceOrType(alias: aliasOpt, targetType: type); 45return new UsedNamespaceOrType(alias: aliasOpt, targetAssembly: assemblyOpt, targetNamespace: @namespace); 51return new UsedNamespaceOrType(alias: alias); 58return new UsedNamespaceOrType(alias: prefix, targetXmlNamespace: xmlNamespace);
34 references to UsedNamespaceOrType
Microsoft.CodeAnalysis (18)
Emit\CommonPEModuleBuilder.cs (1)
225public abstract ImmutableArray<Cci.UsedNamespaceOrType> GetImports();
NativePdbWriter\PdbWriter.cs (4)
170foreach (var import in scope.GetUsedNamespaces(Context)) 191foreach (UsedNamespaceOrType import in scope.GetUsedNamespaces(Context)) 219foreach (UsedNamespaceOrType import in module.GetImports()) 241private string TryEncodeImport(UsedNamespaceOrType import, HashSet<string> declaredExternAliasesOpt, bool isProjectLevel)
PEWriter\IImportScope.cs (1)
19ImmutableArray<UsedNamespaceOrType> GetUsedNamespaces(EmitContext context);
PEWriter\MetadataWriter.PortablePdb.cs (3)
332private void SerializeImport(BlobBuilder writer, UsedNamespaceOrType import) 424foreach (UsedNamespaceOrType import in module.GetImports()) 460foreach (UsedNamespaceOrType import in scope.GetUsedNamespaces(Context))
PEWriter\ReferenceIndexer.cs (2)
127private void VisitImports(ImmutableArray<UsedNamespaceOrType> imports) 137foreach (var import in imports)
PEWriter\UsedNamespaceOrType.cs (7)
14internal readonly struct UsedNamespaceOrType : IEquatable<UsedNamespaceOrType> 36internal static UsedNamespaceOrType CreateType(ITypeReference type, string? aliasOpt = null) 42internal static UsedNamespaceOrType CreateNamespace(INamespace @namespace, IAssemblyReference? assemblyOpt = null, string? aliasOpt = null) 48internal static UsedNamespaceOrType CreateExternAlias(string alias) 54internal static UsedNamespaceOrType CreateXmlNamespace(string prefix, string xmlNamespace) 63return obj is UsedNamespaceOrType other && Equals(other); 66public bool Equals(UsedNamespaceOrType other)
Microsoft.CodeAnalysis.CSharp (16)
Binder\ImportChain.cs (9)
35ImmutableArray<Cci.UsedNamespaceOrType> Cci.IImportScope.GetUsedNamespaces(EmitContext context) 37bool result = ((Emit.PEModuleBuilder)context.Module).TryGetTranslatedImports(this, out ImmutableArray<Cci.UsedNamespaceOrType> imports); 59private ImmutableArray<Cci.UsedNamespaceOrType> TranslateImports(Emit.PEModuleBuilder moduleBuilder, DiagnosticBag diagnostics) 61var usedNamespaces = ArrayBuilder<Cci.UsedNamespaceOrType>.GetInstance(); 70usedNamespaces.Add(Cci.UsedNamespaceOrType.CreateExternAlias(alias.Alias.Name)); 84usedNamespaces.Add(Cci.UsedNamespaceOrType.CreateNamespace(ns.GetCciAdapter(), assemblyRef)); 90usedNamespaces.Add(Cci.UsedNamespaceOrType.CreateType(typeRef)); 114usedNamespaces.Add(Cci.UsedNamespaceOrType.CreateNamespace(ns.GetCciAdapter(), assemblyRef, alias)); 122usedNamespaces.Add(Cci.UsedNamespaceOrType.CreateType(typeRef, alias));
Emitter\Model\PEModuleBuilder.cs (7)
33private readonly ConcurrentDictionary<ImportChain, ImmutableArray<Cci.UsedNamespaceOrType>> _translatedImportsMap = 34new ConcurrentDictionary<ImportChain, ImmutableArray<Cci.UsedNamespaceOrType>>(ReferenceEqualityComparer.Instance); 151public sealed override ImmutableArray<Cci.UsedNamespaceOrType> GetImports() => ImmutableArray<Cci.UsedNamespaceOrType>.Empty; 2303internal bool TryGetTranslatedImports(ImportChain chain, out ImmutableArray<Cci.UsedNamespaceOrType> imports) 2308internal ImmutableArray<Cci.UsedNamespaceOrType> GetOrAddTranslatedImports(ImportChain chain, ImmutableArray<Cci.UsedNamespaceOrType> imports)