16 instantiations of RuntimeTypeHandle
System.Private.CoreLib (16)
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (1)
30get => new RuntimeTypeHandle(this);
src\System\Runtime\InteropServices\DynamicInterfaceCastableHelpers.cs (2)
18bool isImplemented = castable.IsInterfaceImplemented(new RuntimeTypeHandle(interfaceType), throwIfNotImplemented); 28RuntimeTypeHandle handle = castable.GetInterfaceImplementation(new RuntimeTypeHandle(interfaceType));
src\System\RuntimeHandles.cs (3)
22new RuntimeTypeHandle(GetRuntimeTypeChecked()); 34new RuntimeTypeHandle(GetRuntimeTypeFromHandleMaybeNull(value)); 1849return new RuntimeTypeHandle(type!);
src\System\RuntimeType.CoreCLR.cs (10)
1438name = new RuntimeTypeHandle(m_runtimeType).ConstructName(formatFlags); 2429RuntimeTypeHandle th = new RuntimeTypeHandle(this); 3566return new RuntimeTypeHandle(this).Instantiate(rt); 3609ret = new RuntimeTypeHandle(this).Instantiate(instantiationRuntimeType); 3627return new RuntimeTypeHandle(this).GetGenericVariableIndex(); 3639Type[] constraints = new RuntimeTypeHandle(this).GetConstraints(); 3666public override Type MakePointerType() => new RuntimeTypeHandle(this).MakePointer(); 3668public override Type MakeByRefType() => new RuntimeTypeHandle(this).MakeByRef(); 3670public override Type MakeArrayType() => new RuntimeTypeHandle(this).MakeSZArray(); 3677return new RuntimeTypeHandle(this).MakeArray(rank);
343 references to RuntimeTypeHandle
dotnet-svcutil-lib (36)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (1)
1127Call(typeof(Type).GetMethod("GetTypeFromHandle", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(RuntimeTypeHandle) }, null));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (17)
114internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 119internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type, SerializationMode mode) 126internal static DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle, SerializationMode mode) 137internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 142internal static DataContract GetGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type type, SerializationMode mode) 158internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 188internal static int GetId(RuntimeTypeHandle typeHandle) 567internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 588internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 638internal static int GetId(RuntimeTypeHandle typeHandle) 677private static DataContract CreateDataContract(int id, RuntimeTypeHandle typeHandle, Type type) 760private static DataContract CreateGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type type) 799private static RuntimeTypeHandle GetDataContractAdapterTypeHandle(RuntimeTypeHandle typeHandle) 2564private RuntimeTypeHandle _value; 2570public TypeHandleRef(RuntimeTypeHandle value) 2575public RuntimeTypeHandle Value
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (1)
348s_internalDeserializeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("InternalDeserialize", Globals.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(int), typeof(RuntimeTypeHandle), typeof(string), typeof(string) });
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerContext.cs (3)
130internal virtual DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 142internal virtual DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type type) 155internal virtual DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
106internal virtual object InternalDeserialize(XmlReaderDelegator xmlReader, int id, RuntimeTypeHandle declaredTypeHandle, string name, string ns)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (1)
37internal override object InternalDeserialize(XmlReaderDelegator xmlReader, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, string name, string ns)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (9)
101internal void InternalSerializeReference(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle) 112internal virtual void InternalSerialize(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle) 127RuntimeTypeHandle objTypeHandle = obj.GetType().TypeHandle; 142internal void SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 158internal virtual void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 177protected virtual void SerializeWithXsiType(XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 256protected void SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, bool verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 579protected virtual void WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (3)
177internal override void InternalSerialize(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle) 251private void InternalSerializeWithSurrogate(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle) 253RuntimeTypeHandle objTypeHandle = isDeclaredType ? declaredTypeHandle : obj.GetType().TypeHandle;
illink (3)
ILLink.RoslynAnalyzer (3)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (3)
18/// <see cref="System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"/> 44/// <item><see cref="System.Reflection.MethodBase.GetMethodFromHandle(System.RuntimeMethodHandle, System.RuntimeTypeHandle)"/></item> 340/// <see cref="System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(System.RuntimeTypeHandle)"/>
Microsoft.CodeAnalysis (1)
SpecialType.cs (1)
237/// Indicates that the type is <see cref="RuntimeTypeHandle"/>.
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Compilers\Core\Portable\SpecialType.cs (1)
237/// Indicates that the type is <see cref="RuntimeTypeHandle"/>.
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
785[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.RuntimeTypeHandle))]
netstandard (1)
netstandard.cs (1)
1819[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.RuntimeTypeHandle))]
System.Linq.Expressions (1)
System\Linq\Expressions\Common\CachedReflectionInfo.cs (1)
25public static MethodInfo MethodBase_GetMethodFromHandle_RuntimeMethodHandle_RuntimeTypeHandle => field ??= typeof(MethodBase).GetMethod(nameof(MethodBase.GetMethodFromHandle), new[] { typeof(RuntimeMethodHandle), typeof(RuntimeTypeHandle) })!;
System.Private.CoreLib (207)
src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
2251private static object InternalBoxEnum(RuntimeTypeHandle type, long value)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
341public override RuntimeTypeHandle TypeHandle => throw new NotSupportedException(SR.NotSupported_NonReflectedType);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (1)
105public override RuntimeTypeHandle TypeHandle => throw new NotSupportedException();
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (1)
346s_Type_GetTypeFromHandle ??= typeof(Type).GetMethod(nameof(Type.GetTypeFromHandle), [typeof(RuntimeTypeHandle)])!;
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvokerCommon.cs (3)
42if (RuntimeTypeHandle.IsByRef(type)) 53if (RuntimeTypeHandle.IsPointer(type)) 57else if (RuntimeTypeHandle.IsFunctionPointer(type))
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (1)
91public override RuntimeTypeHandle TypeHandle => throw new NotSupportedException(SR.NotSupported_ModifiedType);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (1)
205public sealed override RuntimeTypeHandle TypeHandle => throw new NotSupportedException(SR.NotSupported_SignatureType);
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeDelegator.cs (1)
53public override RuntimeTypeHandle TypeHandle => typeImpl.TypeHandle;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\QCallHandles.cs (1)
125internal QCallTypeHandle(ref RuntimeTypeHandle rth)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\IDynamicInterfaceCastable.cs (4)
32bool IsInterfaceImplemented(RuntimeTypeHandle interfaceType, bool throwIfNotImplemented); 48RuntimeTypeHandle GetInterfaceImplementation(RuntimeTypeHandle interfaceType); 52/// Attribute required by any type that is returned by <see cref="IDynamicInterfaceCastable.GetInterfaceImplementation(RuntimeTypeHandle)"/>.
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (17)
16public override Assembly Assembly => RuntimeTypeHandle.GetAssembly(this); 18public override bool IsGenericParameter => RuntimeTypeHandle.IsGenericVariable(this); 19public override bool IsTypeDefinition => RuntimeTypeHandle.IsTypeDefinition(this); 24public override int MetadataToken => RuntimeTypeHandle.GetToken(this); 27public override RuntimeTypeHandle TypeHandle 48return RuntimeTypeHandle.GetArrayRank(this); 51protected override TypeAttributes GetAttributeFlagsImpl() => RuntimeTypeHandle.GetAttributes(this); 115public override Type? GetElementType() => RuntimeTypeHandle.GetElementType(this); 189internal RuntimeModule GetRuntimeModule() => RuntimeTypeHandle.GetModule(this); 204protected override bool HasElementTypeImpl() => RuntimeTypeHandle.HasElementType(this); 206protected override bool IsArrayImpl() => RuntimeTypeHandle.IsArray(this); 270protected override bool IsByRefImpl() => RuntimeTypeHandle.IsByRef(this); 272protected override bool IsPrimitiveImpl() => RuntimeTypeHandle.IsPrimitive(this); 274protected override bool IsPointerImpl() => RuntimeTypeHandle.IsPointer(this); 290return RuntimeTypeHandle.CanCastTo(fromType, this); 717if (RuntimeTypeHandle.IsGenericVariable(this)) 795elementType = RuntimeTypeHandle.GetElementType(type)!;
src\libraries\System.Private.CoreLib\src\System\Type.cs (2)
467public virtual RuntimeTypeHandle TypeHandle 473public static RuntimeTypeHandle GetTypeHandle(object o)
src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (1)
82return RuntimeTypeHandle.IsVisible(rt);
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (1)
85public static RuntimeTypeHandle TargetTypeToken(TypedReference value)
src\System\ArgIterator.cs (2)
191public System.TypedReference GetNextArg(System.RuntimeTypeHandle rth) 196public unsafe System.RuntimeTypeHandle GetNextArgType()
src\System\Collections\Generic\ArraySortHelper.CoreCLR.cs (2)
28defaultArraySortHelper = (IArraySortHelper<T>)RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(GenericArraySortHelper<string>), (RuntimeType)typeof(T)); 61defaultArraySortHelper = (IArraySortHelper<TKey, TValue>)RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(GenericArraySortHelper<string, string>), (RuntimeType)typeof(TKey), (RuntimeType)typeof(TValue));
src\System\Collections\Generic\ComparerHelpers.cs (1)
5using static System.RuntimeTypeHandle;
src\System\Delegate.CoreCLR.cs (1)
438return Unsafe.As<MulticastDelegate>(RuntimeTypeHandle.InternalAlloc(type));
src\System\GC.CoreCLR.cs (2)
831AllocateNewArray(RuntimeTypeHandle.ToIntPtr(typeof(T[]).TypeHandle), length, flags, ObjectHandleOnStack.Create(ref result)); 852AllocateNewArray(RuntimeTypeHandle.ToIntPtr(typeof(T[]).TypeHandle), length, flags, ObjectHandleOnStack.Create(ref result));
src\System\MulticastDelegate.CoreCLR.cs (1)
171MulticastDelegate result = Unsafe.As<MulticastDelegate>(RuntimeTypeHandle.InternalAllocNoChecks(RuntimeHelpers.GetMethodTable(this)));
src\System\Object.CoreCLR.cs (1)
17RuntimeType type = RuntimeTypeHandle.GetRuntimeType(pMT);
src\System\Reflection\Associates.cs (4)
66RuntimeMethodHandleInternal associateMethodHandle = ModuleHandle.ResolveMethodHandleInternal(RuntimeTypeHandle.GetModule(declaredType), tkMethod, genericArgumentHandles, default); 90(RuntimeTypeHandle.GetAttributes(declaredType) & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Class; 98associateMethodHandle = RuntimeTypeHandle.GetMethodAt(reflectedType, slot); 132while (RuntimeTypeHandle.IsGenericVariable(reflectedType))
src\System\Reflection\Emit\DynamicILGenerator.cs (12)
779if (handle is RuntimeTypeHandle) 781typeHandle = ((RuntimeTypeHandle)handle).Value; 942public int GetTokenFor(RuntimeMethodHandle method, RuntimeTypeHandle contextType) 950public int GetTokenFor(RuntimeFieldHandle field, RuntimeTypeHandle contextType) 954public int GetTokenFor(RuntimeTypeHandle type) 1032public int GetTokenFor(RuntimeMethodHandle method, RuntimeTypeHandle typeContext) 1047public int GetTokenFor(RuntimeFieldHandle field, RuntimeTypeHandle typeContext) 1052public int GetTokenFor(RuntimeTypeHandle type) 1073internal RuntimeTypeHandle m_context; 1075internal GenericMethodInfo(RuntimeMethodHandle methodHandle, RuntimeTypeHandle context) 1085internal RuntimeTypeHandle m_context; 1087internal GenericFieldInfo(RuntimeFieldHandle fieldHandle, RuntimeTypeHandle context)
src\System\Reflection\Emit\RuntimeEnumBuilder.cs (1)
79public override RuntimeTypeHandle TypeHandle => m_typeBuilder.TypeHandle;
src\System\Reflection\Emit\RuntimeGenericTypeParameterBuilder.cs (1)
92public override RuntimeTypeHandle TypeHandle => throw new NotSupportedException();
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (1)
150private int GetMemberRefOfFieldInfo(int tkType, RuntimeTypeHandle declaringType, RuntimeFieldInfo runtimeField)
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
651public override RuntimeTypeHandle TypeHandle => throw new NotSupportedException(SR.NotSupported_DynamicModule);
src\System\Reflection\FieldInfo.CoreCLR.cs (1)
24public static FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle, RuntimeTypeHandle declaringType)
src\System\Reflection\MdConstant.cs (1)
8public static unsafe object? GetValue(MetadataImport scope, int token, RuntimeTypeHandle fieldTypeHandle, bool raw)
src\System\Reflection\MdFieldInfo.cs (1)
22int tkField, FieldAttributes fieldAttributes, RuntimeTypeHandle declaringTypeHandle, RuntimeTypeCache reflectedTypeCache, BindingFlags bindingFlags)
src\System\Reflection\MethodBase.CoreCLR.cs (1)
31public static MethodBase? GetMethodFromHandle(RuntimeMethodHandle handle, RuntimeTypeHandle declaringType)
src\System\Reflection\RtFieldInfo.cs (1)
66return RuntimeTypeHandle.GetModule(RuntimeFieldHandle.GetApproxDeclaringType(this));
src\System\Reflection\RuntimeConstructorInfo.CoreCLR.cs (1)
174internal RuntimeModule GetRuntimeModule() { return RuntimeTypeHandle.GetModule(m_declaringType); }
src\System\Reflection\RuntimeCustomAttributeData.cs (2)
1697RuntimeTypeHandle parentTypeHandle = tkParent.IsTypeDef ? 1701RuntimeTypeHandle attributeTypeHandle = attributeType.TypeHandle;
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (4)
118if (RuntimeTypeHandle.GetNumVirtuals(parent) <= slot) 121return (RuntimeMethodInfo?)RuntimeType.GetMethodBase(parent, RuntimeTypeHandle.GetMethodAt(parent, slot)); 336int cVtblSlots = RuntimeTypeHandle.GetNumVirtuals(declaringType); 341baseMethodHandle = RuntimeTypeHandle.GetMethodAt(declaringType, slot);
src\System\Reflection\RuntimeModule.cs (9)
27private static RuntimeTypeHandle[]? ConvertToTypeHandleArray(Type[]? genericArguments) 33RuntimeTypeHandle[] typeHandleArgs = new RuntimeTypeHandle[size]; 95RuntimeTypeHandle[]? typeArgs = null; 96RuntimeTypeHandle[]? methodArgs = null; 168RuntimeTypeHandle[]? typeArgs = null; 169RuntimeTypeHandle[]? methodArgs = null; 231RuntimeTypeHandle[]? typeArgs = null; 232RuntimeTypeHandle[]? methodArgs = null;
src\System\Reflection\TypeNameResolver.CoreCLR.cs (3)
128RuntimeTypeHandle.RegisterCollectibleTypeDependency(type, requestingAssembly); 169RuntimeTypeHandle.RegisterCollectibleTypeDependency(type, requestingAssembly); 272return RuntimeTypeHandle.GetRuntimeTypeFromHandle(typeHandle);
src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (1)
203return RuntimeTypeHandle.InternalAllocNoChecks((MethodTable*)pMT);
src\System\Runtime\CompilerServices\CastHelpers.cs (1)
554object boxed = RuntimeTypeHandle.InternalAllocNoChecks(typeMT);
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (8)
90RuntimeTypeHandle targetTypeHandle, 169public static void RunClassConstructor(RuntimeTypeHandle type) 204public static unsafe void PrepareMethod(RuntimeMethodHandle method, RuntimeTypeHandle[]? instantiation) 210instantiation = (RuntimeTypeHandle[]?)instantiation?.Clone(); 212ReadOnlySpan<IntPtr> instantiationHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(instantiation, stackScratch: stackalloc IntPtr[8]); 580public static object? Box(ref byte target, RuntimeTypeHandle type) 601public static int SizeOf(RuntimeTypeHandle type) 1169return new TypeHandle((void*)RuntimeTypeHandle.ToIntPtr(typeof(T).TypeHandle));
src\System\Runtime\InteropServices\DynamicInterfaceCastableHelpers.cs (1)
28RuntimeTypeHandle handle = castable.GetInterfaceImplementation(new RuntimeTypeHandle(interfaceType));
src\System\RuntimeHandles.cs (59)
18public unsafe partial struct RuntimeTypeHandle : IEquatable<RuntimeTypeHandle>, ISerializable 21internal RuntimeTypeHandle GetNativeHandle() => 29/// Returns a new <see cref="RuntimeTypeHandle"/> object created from a handle to a RuntimeType. 31/// <param name="value">An IntPtr handle to a RuntimeType to create a <see cref="RuntimeTypeHandle"/> object from.</param> 32/// <returns>A new <see cref="RuntimeTypeHandle"/> object that corresponds to the value parameter.</returns> 33public static RuntimeTypeHandle FromIntPtr(IntPtr value) => 76/// Returns the internal pointer representation of a <see cref="RuntimeTypeHandle"/> object. 78/// <param name="value">A <see cref="RuntimeTypeHandle"/> object to retrieve an internal pointer representation from.</param> 79/// <returns>An <see cref="IntPtr"/> object that represents a <see cref="RuntimeTypeHandle"/> object.</returns> 81public static IntPtr ToIntPtr(RuntimeTypeHandle value) => value.Value; 83public static bool operator ==(RuntimeTypeHandle left, object? right) => left.Equals(right); 85public static bool operator ==(object? left, RuntimeTypeHandle right) => right.Equals(left); 87public static bool operator !=(RuntimeTypeHandle left, object? right) => !left.Equals(right); 89public static bool operator !=(object? left, RuntimeTypeHandle right) => !right.Equals(left); 98=> (obj is RuntimeTypeHandle handle) && ReferenceEquals(handle.m_type, m_type); 100public bool Equals(RuntimeTypeHandle handle) 183internal static ReadOnlySpan<IntPtr> CopyRuntimeTypeHandles(RuntimeTypeHandle[]? inHandles, Span<IntPtr> stackScratch) 584RuntimeTypeHandle nativeHandle = GetNativeHandle(); 596RuntimeTypeHandle nativeHandle = GetNativeHandle(); 605RuntimeTypeHandle nativeHandle = GetNativeHandle(); 624internal void VerifyInterfaceIsImplemented(RuntimeTypeHandle interfaceHandle) 626RuntimeTypeHandle nativeHandle = GetNativeHandle(); 627RuntimeTypeHandle nativeInterfaceHandle = interfaceHandle.GetNativeHandle(); 634internal RuntimeMethodHandleInternal GetInterfaceMethodImplementation(RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle) 636RuntimeTypeHandle nativeHandle = GetNativeHandle(); 637RuntimeTypeHandle nativeInterfaceHandle = interfaceHandle.GetNativeHandle(); 656RuntimeTypeHandle nativeHandle = GetNativeHandle(); 742RuntimeTypeHandle nativeHandle = GetNativeHandle(); 750RuntimeTypeHandle nativeHandle = GetNativeHandle(); 763RuntimeTypeHandle nativeHandle = GetNativeHandle(); 776RuntimeTypeHandle nativeHandle = GetNativeHandle(); 789RuntimeTypeHandle nativeHandle = GetNativeHandle(); 800RuntimeTypeHandle nativeHandle = GetNativeHandle(); 811RuntimeTypeHandle nativeHandle = GetNativeHandle(); 822RuntimeTypeHandle nativeHandle = GetNativeHandle(); 1098return RuntimeTypeHandle.GetRuntimeType(pMT); 1204object obj = RuntimeTypeHandle.InternalAlloc(pMT); 1529return RuntimeTypeHandle.GetRuntimeType(pMT); 1817public RuntimeTypeHandle GetRuntimeTypeHandleFromMetadataToken(int typeToken) { return ResolveTypeHandle(typeToken); } 1819public RuntimeTypeHandle ResolveTypeHandle(int typeToken) => ResolveTypeHandle(typeToken, null, null); 1821public RuntimeTypeHandle ResolveTypeHandle(int typeToken, RuntimeTypeHandle[]? typeInstantiationContext, RuntimeTypeHandle[]? methodInstantiationContext) 1832typeInstantiationContext = (RuntimeTypeHandle[]?)typeInstantiationContext.Clone(); 1833typeInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1837methodInstantiationContext = (RuntimeTypeHandle[]?)methodInstantiationContext.Clone(); 1838methodInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1876public RuntimeMethodHandle ResolveMethodHandle(int methodToken, RuntimeTypeHandle[]? typeInstantiationContext, RuntimeTypeHandle[]? methodInstantiationContext) 1880typeInstantiationContext = (RuntimeTypeHandle[]?)typeInstantiationContext?.Clone(); 1881methodInstantiationContext = (RuntimeTypeHandle[]?)methodInstantiationContext?.Clone(); 1883ReadOnlySpan<IntPtr> typeInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1884ReadOnlySpan<IntPtr> methodInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1927public RuntimeFieldHandle ResolveFieldHandle(int fieldToken, RuntimeTypeHandle[]? typeInstantiationContext, RuntimeTypeHandle[]? methodInstantiationContext) 1938typeInstantiationContext = (RuntimeTypeHandle[]?)typeInstantiationContext.Clone(); 1939typeInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1943methodInstantiationContext = (RuntimeTypeHandle[]?)methodInstantiationContext.Clone(); 1944methodInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, stackScratch: stackalloc IntPtr[8]);
src\System\RuntimeType.ActivatorCache.cs (1)
52RuntimeTypeHandle.GetActivationInfo(rt,
src\System\RuntimeType.BoxCache.cs (1)
13/// A cache which allows optimizing <see cref="RuntimeHelpers.Box(ref byte, RuntimeTypeHandle)"/>.
src\System\RuntimeType.CoreCLR.cs (44)
310!RuntimeTypeHandle.CompareCanonicalHandles(approxDeclaringType, ReflectedType) : 586foreach (RuntimeMethodHandleInternal methodHandle in RuntimeTypeHandle.GetIntroducedMethods(declaringType)) 628while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 631int numVirtuals = RuntimeTypeHandle.GetNumVirtuals(declaringType); 642int vtableSlots = RuntimeTypeHandle.GetNumVirtuals(declaringType); 644foreach (RuntimeMethodHandleInternal methodHandle in RuntimeTypeHandle.GetIntroducedMethods(declaringType)) 747foreach (RuntimeMethodHandleInternal methodHandle in RuntimeTypeHandle.GetIntroducedMethods(declaringType)) 796while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 818interfaces = RuntimeTypeHandle.GetInterfaces(ReflectedType); 836while (!RuntimeTypeHandle.GetFields(declaringType, result, out count)) 854bool needsStaticFieldForGeneric = declaringType.IsGenericType && !RuntimeTypeHandle.ContainsGenericVariables(declaringType); 900int tkDeclaringType = RuntimeTypeHandle.GetToken(declaringType); 962if (filter.Match(RuntimeTypeHandle.GetUtf8Name(iList))) 971if (iFace.IsGenericType && filter.Match(RuntimeTypeHandle.GetUtf8Name(iFace))) 988if (!RuntimeTypeHandle.IsGenericVariable(declaringType)) 990Type[] ifaces = RuntimeTypeHandle.GetInterfaces(declaringType); 997if (!filter.Match(RuntimeTypeHandle.GetUtf8Name(interfaceType))) 1042if (!filter.RequiresStringComparison() || filter.Match(RuntimeTypeHandle.GetUtf8Name(rt))) 1060while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 1065int tkEnclosingType = RuntimeTypeHandle.GetToken(declaringType); 1073ModuleHandle moduleHandle = new ModuleHandle(RuntimeTypeHandle.GetModule(declaringType)); 1095if (!filter.Match(RuntimeTypeHandle.GetUtf8Name(nestedType))) 1118while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 1141int tkDeclaringType = RuntimeTypeHandle.GetToken(declaringType); 1211while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 1219int numVirtuals = RuntimeTypeHandle.GetNumVirtuals(declaringType); 1248int tkDeclaringType = RuntimeTypeHandle.GetToken(declaringType); 1259int numVirtuals = RuntimeTypeHandle.GetNumVirtuals(declaringType); 1430m_isGlobal = RuntimeTypeHandle.GetModule(runtimeType).RuntimeType == runtimeType; 1479return new(RuntimeTypeHandle.GetArgumentTypesFromFunctionPointer(type)); 1541RuntimeType? enclosingType = RuntimeTypeHandle.GetDeclaringType(GetRuntimeType()); 1603RuntimeTypeHandle.GetGenericTypeDefinition(new QCallTypeHandle(ref type), ObjectHandleOnStack.Create(ref genericDefinition)); 1742RuntimeType result = RuntimeTypeHandle.GetRuntimeType(pParentMT); 1936!RuntimeTypeHandle.CompareCanonicalHandles(declaredType, reflectedType)) 1993if (!RuntimeTypeHandle.SatisfiesConstraints(genericParameter.TypeHandle.GetRuntimeTypeChecked(), 2429RuntimeTypeHandle th = new RuntimeTypeHandle(this); 2696RuntimeTypeHandle ifaceRtTypeHandle = ifaceRtType.TypeHandle; 2707int ifaceVirtualMethodCount = RuntimeTypeHandle.GetNumVirtualsAndStaticVirtuals(ifaceRtType); 2718RuntimeMethodHandleInternal ifaceRtMethodHandle = RuntimeTypeHandle.GetMethodAt(ifaceRtType, i); 3235return RuntimeTypeHandle.IsCollectible(new QCallTypeHandle(ref thisType)) != Interop.BOOL.FALSE; 3246IRuntimeMethodInfo? declaringMethod = RuntimeTypeHandle.GetDeclaringMethodForGenericParameter(this); 3531public sealed override bool IsSZArray => RuntimeTypeHandle.IsSZArray(this); 3748public override bool IsFunctionPointer => RuntimeTypeHandle.IsFunctionPointer(this); 3749public override bool IsUnmanagedFunctionPointer => RuntimeTypeHandle.IsUnmanagedFunctionPointer(this);
src\System\Type.CoreCLR.cs (1)
82public static Type? GetTypeFromHandle(RuntimeTypeHandle handle)
System.Private.DataContractSerialization (57)
System\Runtime\Serialization\DataContract.cs (14)
68internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle) 77internal static DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 85internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 92internal static DataContract GetGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 105internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 120internal static int GetId(RuntimeTypeHandle typeHandle) 353internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 369internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 408internal static int GetId(RuntimeTypeHandle typeHandle) 445private static DataContract CreateDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 525private static DataContract CreateGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 580private static RuntimeTypeHandle GetDataContractAdapterTypeHandle(RuntimeTypeHandle typeHandle) 950RuntimeTypeHandle runtimeTypeHandle = GetDataContractAdapterTypeHandle(type.TypeHandle);
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (1)
422internal static void WriteJsonValue(JsonDataContract contract, XmlWriterDelegator writer, object graph, XmlObjectSerializerWriteContextComplexJson? context, RuntimeTypeHandle declaredTypeHandle)
System\Runtime\Serialization\Json\JsonClassDataContract.cs (1)
106public override void WriteJsonValueCore(XmlWriterDelegator jsonWriter, object obj, XmlObjectSerializerWriteContextComplexJson? context, RuntimeTypeHandle declaredTypeHandle)
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (1)
151public override void WriteJsonValueCore(XmlWriterDelegator jsonWriter, object obj, XmlObjectSerializerWriteContextComplexJson? context, RuntimeTypeHandle declaredTypeHandle)
System\Runtime\Serialization\Json\JsonDataContract.cs (3)
96public void WriteJsonValue(XmlWriterDelegator jsonWriter, object obj, XmlObjectSerializerWriteContextComplexJson? context, RuntimeTypeHandle declaredTypeHandle) 105public virtual void WriteJsonValueCore(XmlWriterDelegator jsonWriter, object obj, XmlObjectSerializerWriteContextComplexJson? context, RuntimeTypeHandle declaredTypeHandle) 189internal static int GetId(RuntimeTypeHandle typeHandle)
System\Runtime\Serialization\Json\JsonEnumDataContract.cs (1)
43public override void WriteJsonValueCore(XmlWriterDelegator jsonWriter, object obj, XmlObjectSerializerWriteContextComplexJson? context, RuntimeTypeHandle declaredTypeHandle)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (3)
704LocalBuilder typeHandleValue = _ilg.DeclareLocal(typeof(RuntimeTypeHandle)); 710_ilg.Call(typeof(RuntimeTypeHandle).GetMethod("Equals", new Type[] { typeof(RuntimeTypeHandle) })!);
System\Runtime\Serialization\Json\JsonObjectDataContract.cs (1)
61public override void WriteJsonValueCore(XmlWriterDelegator jsonWriter, object obj, XmlObjectSerializerWriteContextComplexJson? context, RuntimeTypeHandle declaredTypeHandle)
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (1)
50public override void WriteJsonValueCore(XmlWriterDelegator jsonWriter, object obj, XmlObjectSerializerWriteContextComplexJson? context, RuntimeTypeHandle declaredTypeHandle)
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (3)
264internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type? type) 273internal override DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type? type) 282internal override DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle)
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (7)
150protected override void WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 173protected override void SerializeWithXsiType(XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle objectTypeHandle, Type? objectType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 242internal override void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 369internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type? type) 378internal override DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type? type) 387internal override DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle)
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (1)
359s_internalDeserializeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("InternalDeserialize", Globals.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(int), typeof(RuntimeTypeHandle), typeof(string), typeof(string) });
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (3)
717LocalBuilder typeHandleValue = _ilg.DeclareLocal(typeof(RuntimeTypeHandle)); 722_ilg.Call(typeof(RuntimeTypeHandle).GetMethod("Equals", new Type[] { typeof(RuntimeTypeHandle) })!);
System\Runtime\Serialization\XmlObjectSerializerContext.cs (3)
107internal virtual DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type? type) 121internal virtual DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type? type) 135internal virtual DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
87internal virtual object? InternalDeserialize(XmlReaderDelegator xmlReader, int id, RuntimeTypeHandle declaredTypeHandle, string name, string ns)
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (1)
31internal override object? InternalDeserialize(XmlReaderDelegator xmlReader, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, string name, string ns)
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (9)
85internal void InternalSerializeReference(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle) 94internal virtual void InternalSerialize(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle) 108RuntimeTypeHandle objTypeHandle = obj.GetType().TypeHandle; 125internal void SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 143internal virtual void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 166protected virtual void SerializeWithXsiType(XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle objectTypeHandle, Type? objectType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 231protected void SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, bool verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 576protected virtual void WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle)
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (3)
141internal override void InternalSerialize(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle) 221private void InternalSerializeWithSurrogate(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, RuntimeTypeHandle declaredTypeHandle) 223RuntimeTypeHandle objTypeHandle = isDeclaredType ? declaredTypeHandle : obj.GetType().TypeHandle;
System.Private.Xml (1)
System\Xml\Serialization\CodeGenerator.cs (1)
774Call(typeof(Type).GetMethod("GetTypeFromHandle", BindingFlags.Static | BindingFlags.Public, new Type[] { typeof(RuntimeTypeHandle) })!);
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingType.cs (1)
150public override RuntimeTypeHandle TypeHandle
System.Reflection.DispatchProxy (1)
System\Reflection\DispatchProxyGenerator.cs (1)
52private static readonly MethodInfo s_getTypeFromHandleMethod = typeof(Type).GetMethod("GetTypeFromHandle", new Type[] { typeof(RuntimeTypeHandle) })!;
System.Reflection.Emit (3)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
341public override RuntimeTypeHandle TypeHandle => throw new NotSupportedException(SR.NotSupported_NonReflectedType);
System\Reflection\Emit\EnumBuilderImpl.cs (1)
52public override RuntimeTypeHandle TypeHandle => _typeBuilder.TypeHandle;
System\Reflection\Emit\GenericTypeParameterBuilderImpl.cs (1)
89public override RuntimeTypeHandle TypeHandle => throw new NotSupportedException();
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Types\RoType.cs (1)
368public sealed override RuntimeTypeHandle TypeHandle => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
739[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.RuntimeTypeHandle))]
System.Runtime.InteropServices (22)
System\Runtime\InteropServices\Marshalling\ComImportInteropInterfaceDetailsStrategy.cs (2)
58public IComExposedDetails? GetComExposedTypeDetails(RuntimeTypeHandle type) => DefaultIUnknownInterfaceDetailsStrategy.Instance.GetComExposedTypeDetails(type); 60public IIUnknownDerivedDetails? GetIUnknownDerivedDetails(RuntimeTypeHandle type)
System\Runtime\InteropServices\Marshalling\ComObject.cs (4)
95RuntimeTypeHandle IDynamicInterfaceCastable.GetInterfaceImplementation(RuntimeTypeHandle interfaceType) 105bool IDynamicInterfaceCastable.IsInterfaceImplemented(RuntimeTypeHandle interfaceType, bool throwIfNotImplemented) 118private bool LookUpVTableInfo(RuntimeTypeHandle handle, out IIUnknownCacheStrategy.TableInfo result, out int qiHResult)
System\Runtime\InteropServices\Marshalling\DefaultCaching.cs (4)
15private readonly ConcurrentDictionary<RuntimeTypeHandle, IIUnknownCacheStrategy.TableInfo> _cache = new(concurrencyLevel: 1, capacity: 16); 17IIUnknownCacheStrategy.TableInfo IIUnknownCacheStrategy.ConstructTableInfo(RuntimeTypeHandle handle, IIUnknownDerivedDetails details, void* ptr) 28bool IIUnknownCacheStrategy.TryGetTableInfo(RuntimeTypeHandle handle, out IIUnknownCacheStrategy.TableInfo info) 33bool IIUnknownCacheStrategy.TrySetTableInfo(RuntimeTypeHandle handle, IIUnknownCacheStrategy.TableInfo info)
System\Runtime\InteropServices\Marshalling\DefaultIUnknownInterfaceDetailsStrategy.cs (2)
10public IComExposedDetails? GetComExposedTypeDetails(RuntimeTypeHandle type) 15public IIUnknownDerivedDetails? GetIUnknownDerivedDetails(RuntimeTypeHandle type)
System\Runtime\InteropServices\Marshalling\IComExposedDetails.cs (1)
21internal static IComExposedDetails? GetFromAttribute(RuntimeTypeHandle handle)
System\Runtime\InteropServices\Marshalling\IIUnknownCacheStrategy.cs (4)
31public RuntimeTypeHandle ManagedType { get; init; } 41TableInfo ConstructTableInfo(RuntimeTypeHandle handle, IIUnknownDerivedDetails interfaceDetails, void* ptr); 49bool TryGetTableInfo(RuntimeTypeHandle handle, out TableInfo info); 57bool TrySetTableInfo(RuntimeTypeHandle handle, TableInfo info);
System\Runtime\InteropServices\Marshalling\IIUnknownDerivedDetails.cs (1)
32internal static IIUnknownDerivedDetails? GetFromAttribute(RuntimeTypeHandle handle)
System\Runtime\InteropServices\Marshalling\IIUnknownInterfaceDetailsStrategy.cs (4)
16/// Given a <see cref="RuntimeTypeHandle"/> get the IUnknown details. 20IIUnknownDerivedDetails? GetIUnknownDerivedDetails(RuntimeTypeHandle type); 23/// Given a <see cref="RuntimeTypeHandle"/> get the details about the type that are exposed to COM. 27IComExposedDetails? GetComExposedTypeDetails(RuntimeTypeHandle type);
System.Windows.Forms (1)
System\Windows\Forms\Accessibility\AccessibleObject.cs (1)
315RuntimeTypeHandle type = GetType().TypeHandle;
System.Xaml (1)
System\Xaml\Runtime\DynamicMethodRuntime.cs (1)
612null, new Type[] { typeof(RuntimeTypeHandle) }, null);