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