3 instantiations of TypeReferenceHandle
System.Reflection.Metadata (3)
System\Reflection\Metadata\TypeSystem\Handles.TypeSystem.cs (3)
700return new TypeReferenceHandle(rowId); 720return new TypeReferenceHandle(handle.RowId); 730return new TypeReferenceHandle(handle.RowId);
171 references to TypeReferenceHandle
BuildValidator (1)
Util.cs (1)
76var typeRef = reader.GetTypeReference((TypeReferenceHandle)memberRef.Parent);
Crossgen2Tasks (1)
PrepareForReadyToRunCompilation.cs (1)
452TypeReference attributeTypeRef = mdReader.GetTypeReference((TypeReferenceHandle)attributeMemberParent);
Microsoft.AspNetCore.App.UnitTests (1)
TargetingPackTests.cs (1)
208var attributeType = reader.GetTypeReference((TypeReferenceHandle)attributeConstructor.Parent);
Microsoft.Cci.Extensions (2)
Extensions\CSharp\CSharpCciExtensions.cs (1)
931TypeReference tr = reader.GetTypeReference((TypeReferenceHandle)handle);
Extensions\CustomAttributeProvider.cs (1)
101public string GetTypeFromReference(SRMetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind = 0) => null; // We only use this for compiler attributes that take a primitive type as a parameter.
Microsoft.CodeAnalysis (27)
Emit\EditAndContinue\DeltaMetadataWriter.cs (2)
451protected override bool TryGetTypeReferenceHandle(ITypeReference reference, out TypeReferenceHandle handle) 459protected override TypeReferenceHandle GetOrAddTypeReferenceHandle(ITypeReference reference)
MetadataReader\MetadataDecoder.cs (7)
159type = GetTypeOfTypeRef((TypeReferenceHandle)token, out isNoPiaLocalType); 450typeSymbol = GetTypeOfTypeRef((TypeReferenceHandle)handle, out isNoPiaLocalType); 496private TypeSymbol GetTypeOfTypeRef(TypeReferenceHandle typeRef, out bool isNoPiaLocalType) 500ConcurrentDictionary<TypeReferenceHandle, TypeSymbol> cache = GetTypeRefHandleToTypeMap(); 788type = GetTypeOfTypeRef((TypeReferenceHandle)token, out isNoPiaLocalType); 930return GetTypeOfTypeRef((TypeReferenceHandle)token, out _); 2133protected abstract ConcurrentDictionary<TypeReferenceHandle, TypeSymbol> GetTypeRefHandleToTypeMap();
MetadataReader\PEModule.cs (6)
416foreach (var handle in MetadataReader.TypeReferences) 2824foreach (var handle in MetadataReader.TypeReferences) 2851return default(TypeReferenceHandle); 2856TypeReferenceHandle handle, 2968TypeReference typeRef = metadataReader.GetTypeReference((TypeReferenceHandle)token); 3118TypeReference typeRefRow = metadataReader.GetTypeReference((TypeReferenceHandle)typeDefOrRef);
PEWriter\FullMetadataWriter.cs (2)
277protected override bool TryGetTypeReferenceHandle(ITypeReference reference, out TypeReferenceHandle handle) 285protected override TypeReferenceHandle GetOrAddTypeReferenceHandle(ITypeReference reference)
PEWriter\MetadataWriter.cs (10)
351protected abstract bool TryGetTypeReferenceHandle(ITypeReference reference, out TypeReferenceHandle handle); 358protected abstract TypeReferenceHandle GetOrAddTypeReferenceHandle(ITypeReference reference); 457private readonly TypeReferenceHandle[,] _dummyAssemblyAttributeParent = { { default(TypeReferenceHandle), default(TypeReferenceHandle) }, { default(TypeReferenceHandle), default(TypeReferenceHandle) } }; 1595private TypeReferenceHandle GetTypeReferenceHandle(ITypeReference typeReference) 1597TypeReferenceHandle result; 2068private TypeReferenceHandle GetDummyAssemblyAttributeParent(bool isSecurity, bool allowMultiple)
Microsoft.CodeAnalysis.CSharp (3)
Symbols\Metadata\PE\MetadataDecoder.cs (1)
111protected override ConcurrentDictionary<TypeReferenceHandle, TypeSymbol> GetTypeRefHandleToTypeMap()
Symbols\Metadata\PE\PEModuleSymbol.cs (2)
76internal readonly ConcurrentDictionary<TypeReferenceHandle, TypeSymbol> TypeRefHandleToTypeMap = 77new ConcurrentDictionary<TypeReferenceHandle, TypeSymbol>(concurrencyLevel: 2, capacity: DefaultTypeMapCapacity);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenFunctionPointersTests.cs (2)
12627var systemObjectTypeRef = metadata.AddTypeReference( 12632var systemConsoleTypeRefHandle = metadata.AddTypeReference(
CodeGen\DestructorTests.cs (1)
786TypeReferenceHandle handleObject = peFileReader.TypeReferences.AsEnumerable().
Emit\CompilationEmitTests.cs (1)
4216foreach (var typeRef in reader.TypeReferences)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\EditAndContinue\EditAndContinueTests.cs (1)
33foreach (var typeRefHandle in currentGenerationReader.TypeReferences)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (9)
Symbols\Metadata\PE\BaseTypeResolution.cs (8)
283Assert.Equal(base1, module0.TypeRefHandleToTypeMap[(TypeReferenceHandle)module0.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)localTC1).Handle)]); 284Assert.Equal(base2, module0.TypeRefHandleToTypeMap[(TypeReferenceHandle)module0.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)localTC2).Handle)]); 285Assert.Equal(base3, module0.TypeRefHandleToTypeMap[(TypeReferenceHandle)module0.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)localTC3).Handle)]); 286Assert.Equal(base4, module0.TypeRefHandleToTypeMap[(TypeReferenceHandle)module0.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)localTC4).Handle)]); 287Assert.Equal(base5, module0.TypeRefHandleToTypeMap[(TypeReferenceHandle)module0.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)localTC5).Handle)]); 288Assert.Equal(base6, module0.TypeRefHandleToTypeMap[(TypeReferenceHandle)module0.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)localTC6).Handle)]); 289Assert.Equal(base7, module0.TypeRefHandleToTypeMap[(TypeReferenceHandle)module0.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)localTC7).Handle)]); 290Assert.Equal(base8, module0.TypeRefHandleToTypeMap[(TypeReferenceHandle)module0.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)localTC8).Handle)]);
Symbols\Metadata\PE\TypeForwarders.cs (1)
65Assert.Equal(base1, module1.TypeRefHandleToTypeMap[(TypeReferenceHandle)module1.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)derived1).Handle)]);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (3)
MetadataDecoder.cs (3)
196return DecodeTypeReference((TypeReferenceHandle)handle, typeArguments, ref typeArgumentOffset); 226TypeReferenceHandle handle, 242qualifier = DecodeTypeReference((TypeReferenceHandle)scope, typeArguments, ref typeArgumentOffset);
Microsoft.CodeAnalysis.Test.Utilities (5)
Metadata\MetadataReaderUtils.cs (4)
171return reader.GetTypeReference((TypeReferenceHandle)token).Name; 367TypeReference type = reader.GetTypeReference((TypeReferenceHandle)handle); 449public string GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) 476.Select(p => metadataReader.GetTypeReference((TypeReferenceHandle)p).Name)
Metadata\MetadataValidation.cs (1)
33var name = metadataReader.GetTypeReference((TypeReferenceHandle)container).Name;
Microsoft.CodeAnalysis.VisualBasic (2)
Symbols\Metadata\PE\MetadataDecoder.vb (1)
109Protected Overrides Function GetTypeRefHandleToTypeMap() As ConcurrentDictionary(Of TypeReferenceHandle, TypeSymbol)
Symbols\Metadata\PE\PEModuleSymbol.vb (1)
68Friend ReadOnly TypeRefHandleToTypeMap As New ConcurrentDictionary(Of TypeReferenceHandle, TypeSymbol)(concurrencyLevel:=2, capacity:=s_defaultTypeMapCapacity)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (9)
SymbolsTests\Metadata\PE\BaseTypeResolution.vb (8)
266Assert.Equal(base1, module0.TypeRefHandleToTypeMap(CType(module0.Module.GetBaseTypeOfTypeOrThrow(DirectCast(TC1, PENamedTypeSymbol).Handle), TypeReferenceHandle))) 267Assert.Equal(base2, module0.TypeRefHandleToTypeMap(CType(module0.Module.GetBaseTypeOfTypeOrThrow(DirectCast(TC2, PENamedTypeSymbol).Handle), TypeReferenceHandle))) 268Assert.Equal(base3, module0.TypeRefHandleToTypeMap(CType(module0.Module.GetBaseTypeOfTypeOrThrow(DirectCast(TC3, PENamedTypeSymbol).Handle), TypeReferenceHandle))) 269Assert.Equal(base4, module0.TypeRefHandleToTypeMap(CType(module0.Module.GetBaseTypeOfTypeOrThrow(DirectCast(TC4, PENamedTypeSymbol).Handle), TypeReferenceHandle))) 270Assert.Equal(base5, module0.TypeRefHandleToTypeMap(CType(module0.Module.GetBaseTypeOfTypeOrThrow(DirectCast(TC5, PENamedTypeSymbol).Handle), TypeReferenceHandle))) 271Assert.Equal(base6, module0.TypeRefHandleToTypeMap(CType(module0.Module.GetBaseTypeOfTypeOrThrow(DirectCast(TC6, PENamedTypeSymbol).Handle), TypeReferenceHandle))) 272Assert.Equal(base7, module0.TypeRefHandleToTypeMap(CType(module0.Module.GetBaseTypeOfTypeOrThrow(DirectCast(TC7, PENamedTypeSymbol).Handle), TypeReferenceHandle))) 273Assert.Equal(base8, module0.TypeRefHandleToTypeMap(CType(module0.Module.GetBaseTypeOfTypeOrThrow(DirectCast(TC8, PENamedTypeSymbol).Handle), TypeReferenceHandle)))
SymbolsTests\Metadata\PE\TypeForwarders.vb (1)
53Assert.Equal(base1, module1.TypeRefHandleToTypeMap(CType(module1.Module.GetBaseTypeOfTypeOrThrow(DirectCast(derived1, PENamedTypeSymbol).Handle), TypeReferenceHandle)))
Microsoft.CodeAnalysis.Workspaces (4)
FindSymbols\SymbolTree\SymbolTreeInfo.FirstEntityHandleProvider.cs (1)
38public EntityHandle GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => handle;
FindSymbols\SymbolTree\SymbolTreeInfo.Node.cs (1)
137public ParameterTypeInfo GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind)
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (2)
596AddTypeReferenceNameParts(metadataReader, (TypeReferenceHandle)typeDefOrRefHandle, simpleNames); 674TypeReferenceHandle handle,
Microsoft.DotNet.SignTool (2)
src\Configuration.cs (2)
630var containerRef = reader.GetTypeReference((TypeReferenceHandle)container); 657public object GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => null;
Roslyn.Test.PdbUtilities (2)
Shared\DummyMetadataImport.cs (2)
128var handle = (TypeReferenceHandle)MetadataTokens.Handle(typeReference);
RunTests (1)
AssemblyScheduler.cs (1)
359var typeNameHandle = metadataReader.GetTypeReference((TypeReferenceHandle)ctor.Parent).Name;
System.Diagnostics.FileVersionInfo (1)
System\Diagnostics\FileVersionInfo.Unix.cs (1)
263TypeReference tr = reader.GetTypeReference((TypeReferenceHandle)container);
System.Reflection.Emit (1)
System\Reflection\Emit\ModuleBuilderImpl.cs (1)
948private TypeReferenceHandle AddTypeReference(EntityHandle resolutionScope, string? ns, string name) =>
System.Reflection.Metadata (78)
System\Reflection\Metadata\Decoding\ISimpleTypeProvider.cs (1)
41TType GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind);
System\Reflection\Metadata\Ecma335\CodedIndex.cs (6)
14/// <see cref="TypeReferenceHandle"/>, 92/// <see cref="TypeReferenceHandle"/>, 110/// <param name="handle"><see cref="ModuleDefinitionHandle"/>, <see cref="ModuleReferenceHandle"/>, <see cref="AssemblyReferenceHandle"/> or <see cref="TypeReferenceHandle"/></param> 117/// <param name="handle"><see cref="TypeDefinitionHandle"/> or <see cref="TypeReferenceHandle"/></param> 124/// <param name="handle"><see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/> or <see cref="TypeSpecificationHandle"/></param> 141/// <see cref="TypeReferenceHandle"/>,
System\Reflection\Metadata\Ecma335\CustomAttributeDecoder.cs (1)
418HandleKind.TypeReference => _provider.GetTypeFromReference(_reader, (TypeReferenceHandle)handle, 0),
System\Reflection\Metadata\Ecma335\Encoding\BlobEncoders.cs (3)
1062/// <param name="type"><see cref="TypeDefinitionHandle"/> or <see cref="TypeReferenceHandle"/>.</param> 1118/// <param name="genericType"><see cref="TypeDefinitionHandle"/> or <see cref="TypeReferenceHandle"/>.</param> 1221/// <param name="type"><see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/> or <see cref="TypeSpecificationHandle"/>.</param>
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (1)
202/// <param name="catchType">The type of exception to be caught: <see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/> or <see cref="TypeSpecificationHandle"/>.</param>
System\Reflection\Metadata\Ecma335\Encoding\ExceptionRegionEncoder.cs (2)
150/// <see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/> or <see cref="TypeSpecificationHandle"/>. 190/// <see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/> or <see cref="TypeSpecificationHandle"/>,
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (10)
450/// <param name="baseType"><see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/>, <see cref="TypeSpecificationHandle"/> or nil.</param> 517/// <see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/> or <see cref="TypeSpecificationHandle"/>. 561/// <see cref="ModuleDefinitionHandle"/>, <see cref="ModuleReferenceHandle"/>, <see cref="AssemblyReferenceHandle"/>, <see cref="TypeReferenceHandle"/>, or nil. 566public TypeReferenceHandle AddTypeReference( 578return TypeReferenceHandle.FromRowId(_typeRefTable.Count); 633/// <param name="type">Type of the event: <see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/>, or <see cref="TypeSpecificationHandle"/></param> 716/// <see cref="TypeReferenceHandle"/>, 855/// <param name="constraint">Type constraint: <see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/> or <see cref="TypeSpecificationHandle"/></param> 1066/// <see cref="TypeReferenceHandle"/>, 1373/// <see cref="TypeReferenceHandle"/>,
System\Reflection\Metadata\Ecma335\MetadataReaderExtensions.cs (1)
411var treatment = reader.GetTypeReference((TypeReferenceHandle)typeHandle).SignatureTreatment;
System\Reflection\Metadata\Ecma335\MetadataTokens.cs (2)
370public static TypeReferenceHandle TypeReferenceHandle(int rowNumber) 372return Metadata.TypeReferenceHandle.FromRowId(ToRowId(rowNumber));
System\Reflection\Metadata\Ecma335\SignatureDecoder.cs (1)
309return _provider.GetTypeFromReference(_metadataReaderOpt, (TypeReferenceHandle)handle, rawTypeKind);
System\Reflection\Metadata\Internal\Tables.cs (3)
102internal EntityHandle GetResolutionScope(TypeReferenceHandle handle) 108internal StringHandle GetName(TypeReferenceHandle handle) 114internal StringHandle GetNamespace(TypeReferenceHandle handle)
System\Reflection\Metadata\MetadataReader.cs (2)
1152public TypeReference GetTypeReference(TypeReferenceHandle handle) 1158private uint GetTypeRefTreatmentAndRowId(TypeReferenceHandle handle)
System\Reflection\Metadata\MetadataReader.WinMD.cs (18)
79private int GetProjectionIndexForTypeReference(TypeReferenceHandle typeRef, out bool isIDisposable) 241if (extends.Kind == HandleKind.TypeReference && IsSystemAttribute((TypeReferenceHandle)extends)) 318internal uint CalculateTypeRefTreatmentAndRowId(TypeReferenceHandle handle) 333private TypeRefTreatment GetSpecialTypeRefTreatment(TypeReferenceHandle handle) 353private bool IsSystemAttribute(TypeReferenceHandle handle) 372TypeReferenceHandle extendsRefHandle = (TypeReferenceHandle)extends; 422switch (GetSpecialTypeRefTreatment((TypeReferenceHandle)parentBaseType)) 553var typeRef = (TypeReferenceHandle)baseTypeHandle; 611TypeReferenceHandle typeRef; 614typeRef = (TypeReferenceHandle)parent; 634typeRef = (TypeReferenceHandle)token; 722var attributeTypeRef = (TypeReferenceHandle)attributeType; 755TypeReferenceHandle typeRef = (TypeReferenceHandle)typeDefOrRef; 794/// <returns><see cref="TypeDefinitionHandle"/> or <see cref="TypeReferenceHandle"/> or nil token if the metadata is invalid and the type can't be determined.</returns>
System\Reflection\Metadata\TypeSystem\GenericParameterConstraint.cs (1)
41/// Handle (<see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/>, or <see cref="TypeSpecificationHandle"/>)
System\Reflection\Metadata\TypeSystem\HandleCollections.TypeSystem.cs (8)
1339/// Represents a collection of <see cref="TypeReferenceHandle"/>. 1341public readonly struct TypeReferenceHandleCollection : IReadOnlyCollection<TypeReferenceHandle> 1361IEnumerator<TypeReferenceHandle> IEnumerable<TypeReferenceHandle>.GetEnumerator() 1371public struct Enumerator : IEnumerator<TypeReferenceHandle>, IEnumerator 1388public TypeReferenceHandle Current 1392return TypeReferenceHandle.FromRowId((int)(_currentRowId & TokenTypeIds.RIDMask)); 1429/// Represents a collection of <see cref="TypeReferenceHandle"/>.
System\Reflection\Metadata\TypeSystem\Handles.TypeSystem.cs (13)
686public readonly struct TypeReferenceHandle : IEquatable<TypeReferenceHandle> 698internal static TypeReferenceHandle FromRowId(int rowId) 703public static implicit operator Handle(TypeReferenceHandle handle) 708public static implicit operator EntityHandle(TypeReferenceHandle handle) 713public static explicit operator TypeReferenceHandle(Handle handle) 723public static explicit operator TypeReferenceHandle(EntityHandle handle) 743public static bool operator ==(TypeReferenceHandle left, TypeReferenceHandle right) 750return obj is TypeReferenceHandle && ((TypeReferenceHandle)obj)._rowId == _rowId; 753public bool Equals(TypeReferenceHandle other) 763public static bool operator !=(TypeReferenceHandle left, TypeReferenceHandle right)
System\Reflection\Metadata\TypeSystem\InterfaceImplementation.cs (1)
32/// <see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/>, or <see cref="TypeSpecificationHandle"/>
System\Reflection\Metadata\TypeSystem\TypeDefinition.cs (1)
109/// <see cref="TypeSpecificationHandle"/>, <see cref="TypeReferenceHandle"/> or <see cref="TypeDefinitionHandle"/>.
System\Reflection\Metadata\TypeSystem\TypeReference.cs (3)
35private TypeReferenceHandle Handle 37get { return TypeReferenceHandle.FromRowId(RowId); } 46/// <item><description><see cref="TypeReferenceHandle"/> of the enclosing type, if the target type is a nested type.</description></item>
System.Reflection.MetadataLoadContext (14)
System\Reflection\TypeLoading\CustomAttributes\Ecma\EcmaCustomAttributeHelpers.cs (1)
71TypeReference tr = ((TypeReferenceHandle)handle).GetTypeReference(reader);
System\Reflection\TypeLoading\General\Ecma\EcmaResolver.cs (5)
22HandleKind.TypeReference => ((TypeReferenceHandle)handle).ResolveTypeRef(module), 39public static RoDefinitionType ResolveTypeRef(this TypeReferenceHandle handle, EcmaModule module) 48(h, m) => ComputeTypeRefResolution((TypeReferenceHandle)h, m); 50private static RoDefinitionType ComputeTypeRefResolution(TypeReferenceHandle handle, EcmaModule module) 87RoDefinitionType outerType = ((TypeReferenceHandle)scope).ResolveTypeRef(module);
System\Reflection\TypeLoading\General\Ecma\EcmaSignatureTypeProviderForToString.cs (1)
28public string GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => handle.ToTypeString(reader);
System\Reflection\TypeLoading\General\Ecma\EcmaToStringHelpers.cs (2)
31return ((TypeReferenceHandle)handle).ToTypeString(reader); 55public static string ToTypeString(this TypeReferenceHandle handle, MetadataReader reader)
System\Reflection\TypeLoading\General\Ecma\EcmaWrappedTypeProvider.cs (1)
34public RoType GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => _typeProvider.GetTypeFromReference(reader, handle, rawTypeKind);
System\Reflection\TypeLoading\General\Ecma\MetadataExtensions.cs (3)
55public static TypeReference GetTypeReference(this TypeReferenceHandle handle, MetadataReader reader) => reader.GetTypeReference(handle); 62public static int GetToken(this TypeReferenceHandle handle) => MetadataTokens.GetToken(handle); 93public static TypeReferenceHandle ToTypeReferenceHandle(this int token) => MetadataTokens.TypeReferenceHandle(token);
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.TypeProvider.cs (1)
20public RoType GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => handle.ResolveTypeRef(this);