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)); 1840return new RuntimeTypeHandle(type!);
src\System\RuntimeType.CoreCLR.cs (10)
1442name ??= new RuntimeTypeHandle(m_runtimeType).ConstructName(formatFlags); 2453RuntimeTypeHandle th = new RuntimeTypeHandle(this); 3587return new RuntimeTypeHandle(this).Instantiate(rt); 3630ret = new RuntimeTypeHandle(this).Instantiate(instantiationRuntimeType); 3648return new RuntimeTypeHandle(this).GetGenericVariableIndex(); 3660Type[] constraints = new RuntimeTypeHandle(this).GetConstraints(); 3687public override Type MakePointerType() => new RuntimeTypeHandle(this).MakePointer(); 3689public override Type MakeByRefType() => new RuntimeTypeHandle(this).MakeByRef(); 3691public override Type MakeArrayType() => new RuntimeTypeHandle(this).MakeSZArray(); 3698return new RuntimeTypeHandle(this).MakeArray(rank);
339 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> 336 /// <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)
67s_MethodBase_GetMethodFromHandle_RuntimeMethodHandle_RuntimeTypeHandle ??= typeof(MethodBase).GetMethod(nameof(MethodBase.GetMethodFromHandle), new[] { typeof(RuntimeMethodHandle), typeof(RuntimeTypeHandle) })!;
System.Private.CoreLib (203)
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)
106public 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); 96public override Type? GetElementType() => RuntimeTypeHandle.GetElementType(this); 170internal RuntimeModule GetRuntimeModule() => RuntimeTypeHandle.GetModule(this); 185protected override bool HasElementTypeImpl() => RuntimeTypeHandle.HasElementType(this); 187protected override bool IsArrayImpl() => RuntimeTypeHandle.IsArray(this); 251protected override bool IsByRefImpl() => RuntimeTypeHandle.IsByRef(this); 253protected override bool IsPrimitiveImpl() => RuntimeTypeHandle.IsPrimitive(this); 255protected override bool IsPointerImpl() => RuntimeTypeHandle.IsPointer(this); 271return RuntimeTypeHandle.CanCastTo(fromType, this); 698if (RuntimeTypeHandle.IsGenericVariable(this)) 776elementType = 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)
824AllocateNewArray(RuntimeTypeHandle.ToIntPtr(typeof(T[]).TypeHandle), length, flags, ObjectHandleOnStack.Create(ref result)); 845AllocateNewArray(RuntimeTypeHandle.ToIntPtr(typeof(T[]).TypeHandle), length, flags, ObjectHandleOnStack.Create(ref result));
src\System\MulticastDelegate.CoreCLR.cs (1)
170MulticastDelegate result = Unsafe.As<MulticastDelegate>(RuntimeTypeHandle.InternalAllocNoChecks((RuntimeType)GetType()));
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)
773if (handle is RuntimeTypeHandle) 775typeHandle = ((RuntimeTypeHandle)handle).Value; 936public int GetTokenFor(RuntimeMethodHandle method, RuntimeTypeHandle contextType) 944public int GetTokenFor(RuntimeFieldHandle field, RuntimeTypeHandle contextType) 948public int GetTokenFor(RuntimeTypeHandle type) 1026public int GetTokenFor(RuntimeMethodHandle method, RuntimeTypeHandle typeContext) 1041public int GetTokenFor(RuntimeFieldHandle field, RuntimeTypeHandle typeContext) 1046public int GetTokenFor(RuntimeTypeHandle type) 1067internal RuntimeTypeHandle m_context; 1069internal GenericMethodInfo(RuntimeMethodHandle methodHandle, RuntimeTypeHandle context) 1079internal RuntimeTypeHandle m_context; 1081internal 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\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 (2)
124RuntimeTypeHandle.RegisterCollectibleTypeDependency(type, requestingAssembly); 159RuntimeTypeHandle.RegisterCollectibleTypeDependency(type, requestingAssembly);
src\System\Runtime\CompilerServices\CastHelpers.cs (1)
628object dst = RuntimeTypeHandle.InternalAlloc(dstMT);
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]); 556public static object? Box(ref byte target, RuntimeTypeHandle type) 577public static int SizeOf(RuntimeTypeHandle type) 1124return 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) 575RuntimeTypeHandle nativeHandle = GetNativeHandle(); 587RuntimeTypeHandle nativeHandle = GetNativeHandle(); 596RuntimeTypeHandle nativeHandle = GetNativeHandle(); 615internal void VerifyInterfaceIsImplemented(RuntimeTypeHandle interfaceHandle) 617RuntimeTypeHandle nativeHandle = GetNativeHandle(); 618RuntimeTypeHandle nativeInterfaceHandle = interfaceHandle.GetNativeHandle(); 625internal RuntimeMethodHandleInternal GetInterfaceMethodImplementation(RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle) 627RuntimeTypeHandle nativeHandle = GetNativeHandle(); 628RuntimeTypeHandle nativeInterfaceHandle = interfaceHandle.GetNativeHandle(); 647RuntimeTypeHandle nativeHandle = GetNativeHandle(); 733RuntimeTypeHandle nativeHandle = GetNativeHandle(); 741RuntimeTypeHandle nativeHandle = GetNativeHandle(); 754RuntimeTypeHandle nativeHandle = GetNativeHandle(); 767RuntimeTypeHandle nativeHandle = GetNativeHandle(); 780RuntimeTypeHandle nativeHandle = GetNativeHandle(); 791RuntimeTypeHandle nativeHandle = GetNativeHandle(); 802RuntimeTypeHandle nativeHandle = GetNativeHandle(); 813RuntimeTypeHandle nativeHandle = GetNativeHandle(); 1089return RuntimeTypeHandle.GetRuntimeType(pMT); 1195object obj = RuntimeTypeHandle.InternalAlloc(pMT); 1520return RuntimeTypeHandle.GetRuntimeType(pMT); 1808public RuntimeTypeHandle GetRuntimeTypeHandleFromMetadataToken(int typeToken) { return ResolveTypeHandle(typeToken); } 1810public RuntimeTypeHandle ResolveTypeHandle(int typeToken) => ResolveTypeHandle(typeToken, null, null); 1812public RuntimeTypeHandle ResolveTypeHandle(int typeToken, RuntimeTypeHandle[]? typeInstantiationContext, RuntimeTypeHandle[]? methodInstantiationContext) 1823typeInstantiationContext = (RuntimeTypeHandle[]?)typeInstantiationContext.Clone(); 1824typeInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1828methodInstantiationContext = (RuntimeTypeHandle[]?)methodInstantiationContext.Clone(); 1829methodInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1867public RuntimeMethodHandle ResolveMethodHandle(int methodToken, RuntimeTypeHandle[]? typeInstantiationContext, RuntimeTypeHandle[]? methodInstantiationContext) 1871typeInstantiationContext = (RuntimeTypeHandle[]?)typeInstantiationContext?.Clone(); 1872methodInstantiationContext = (RuntimeTypeHandle[]?)methodInstantiationContext?.Clone(); 1874ReadOnlySpan<IntPtr> typeInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1875ReadOnlySpan<IntPtr> methodInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1918public RuntimeFieldHandle ResolveFieldHandle(int fieldToken, RuntimeTypeHandle[]? typeInstantiationContext, RuntimeTypeHandle[]? methodInstantiationContext) 1929typeInstantiationContext = (RuntimeTypeHandle[]?)typeInstantiationContext.Clone(); 1930typeInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, stackScratch: stackalloc IntPtr[8]); 1934methodInstantiationContext = (RuntimeTypeHandle[]?)methodInstantiationContext.Clone(); 1935methodInstantiationContextHandles = 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)
317!RuntimeTypeHandle.CompareCanonicalHandles(approxDeclaringType, ReflectedType) : 593foreach (RuntimeMethodHandleInternal methodHandle in RuntimeTypeHandle.GetIntroducedMethods(declaringType)) 635while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 638int numVirtuals = RuntimeTypeHandle.GetNumVirtuals(declaringType); 649int vtableSlots = RuntimeTypeHandle.GetNumVirtuals(declaringType); 651foreach (RuntimeMethodHandleInternal methodHandle in RuntimeTypeHandle.GetIntroducedMethods(declaringType)) 754foreach (RuntimeMethodHandleInternal methodHandle in RuntimeTypeHandle.GetIntroducedMethods(declaringType)) 803while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 825interfaces = RuntimeTypeHandle.GetInterfaces(ReflectedType); 843while (!RuntimeTypeHandle.GetFields(declaringType, result, out count)) 861bool needsStaticFieldForGeneric = declaringType.IsGenericType && !RuntimeTypeHandle.ContainsGenericVariables(declaringType); 907int tkDeclaringType = RuntimeTypeHandle.GetToken(declaringType); 969if (filter.Match(RuntimeTypeHandle.GetUtf8Name(iList))) 978if (iFace.IsGenericType && filter.Match(RuntimeTypeHandle.GetUtf8Name(iFace))) 995if (!RuntimeTypeHandle.IsGenericVariable(declaringType)) 997Type[] ifaces = RuntimeTypeHandle.GetInterfaces(declaringType); 1004if (!filter.Match(RuntimeTypeHandle.GetUtf8Name(interfaceType))) 1049if (!filter.RequiresStringComparison() || filter.Match(RuntimeTypeHandle.GetUtf8Name(rt))) 1067while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 1072int tkEnclosingType = RuntimeTypeHandle.GetToken(declaringType); 1080ModuleHandle moduleHandle = new ModuleHandle(RuntimeTypeHandle.GetModule(declaringType)); 1102if (!filter.Match(RuntimeTypeHandle.GetUtf8Name(nestedType))) 1125while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 1148int tkDeclaringType = RuntimeTypeHandle.GetToken(declaringType); 1218while (RuntimeTypeHandle.IsGenericVariable(declaringType)) 1226int numVirtuals = RuntimeTypeHandle.GetNumVirtuals(declaringType); 1255int tkDeclaringType = RuntimeTypeHandle.GetToken(declaringType); 1266int numVirtuals = RuntimeTypeHandle.GetNumVirtuals(declaringType); 1436m_isGlobal = RuntimeTypeHandle.GetModule(runtimeType).RuntimeType == runtimeType; 1483return new(RuntimeTypeHandle.GetArgumentTypesFromFunctionPointer(type)); 1565RuntimeType? enclosingType = RuntimeTypeHandle.GetDeclaringType(GetRuntimeType()); 1627RuntimeTypeHandle.GetGenericTypeDefinition(new QCallTypeHandle(ref type), ObjectHandleOnStack.Create(ref genericDefinition)); 1766RuntimeType result = RuntimeTypeHandle.GetRuntimeType(pParentMT); 1960!RuntimeTypeHandle.CompareCanonicalHandles(declaredType, reflectedType)) 2017if (!RuntimeTypeHandle.SatisfiesConstraints(genericParameter.TypeHandle.GetRuntimeTypeChecked(), 2453RuntimeTypeHandle th = new RuntimeTypeHandle(this); 2720RuntimeTypeHandle ifaceRtTypeHandle = ifaceRtType.TypeHandle; 2731int ifaceVirtualMethodCount = RuntimeTypeHandle.GetNumVirtualsAndStaticVirtuals(ifaceRtType); 2741RuntimeMethodHandleInternal ifaceRtMethodHandle = RuntimeTypeHandle.GetMethodAt(ifaceRtType, i); 3243return RuntimeTypeHandle.IsCollectible(new QCallTypeHandle(ref thisType)) != Interop.BOOL.FALSE; 3254IRuntimeMethodInfo? declaringMethod = RuntimeTypeHandle.GetDeclaringMethodForGenericParameter(this); 3552public sealed override bool IsSZArray => RuntimeTypeHandle.IsSZArray(this); 3769public override bool IsFunctionPointer => RuntimeTypeHandle.IsFunctionPointer(this); 3770public 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)
62internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle) 71internal static DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 79internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 86internal static DataContract GetGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 99internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 114internal static int GetId(RuntimeTypeHandle typeHandle) 336internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 352internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 391internal static int GetId(RuntimeTypeHandle typeHandle) 428private static DataContract CreateDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 508private static DataContract CreateGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 563private static RuntimeTypeHandle GetDataContractAdapterTypeHandle(RuntimeTypeHandle typeHandle) 933RuntimeTypeHandle runtimeTypeHandle = GetDataContractAdapterTypeHandle(type.TypeHandle);
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (1)
413internal 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)
364s_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)
89internal 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)
86internal void InternalSerializeReference(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle) 95internal virtual void InternalSerialize(XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle) 109RuntimeTypeHandle objTypeHandle = obj.GetType().TypeHandle; 126internal void SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 144internal virtual void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 167protected virtual void SerializeWithXsiType(XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle objectTypeHandle, Type? objectType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 232protected void SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, bool verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 577protected 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)
372public 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)
715[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)
611null, new Type[] { typeof(RuntimeTypeHandle) }, null);