73 references to ToType
System.Private.CoreLib (73)
Internal\Reflection\Augments\ReflectionAugments.cs (1)
372Type? type = containingType.ToType();
System\Reflection\ModifiedType.NativeAot.cs (1)
107builder.Add(modifiedType.ModifierType.Resolve(reader, new TypeContext(null, null)).ToType());
System\Reflection\Runtime\Assemblies\NativeFormat\NativeFormatRuntimeAssembly.cs (2)
49yield return (TypeInfo)typeDefinitionHandle.GetNamedType(reader).ToType(); 65yield return typeDefinitionHandle.ResolveTypeDefinition(reader).ToType();
System\Reflection\Runtime\Assemblies\RuntimeAssemblyInfo.cs (1)
168return type.ToType();
System\Reflection\Runtime\CustomAttributes\NativeFormat\NativeFormatCustomAttributeData.cs (5)
43lazyAttributeType = _lazyAttributeType = _customAttribute.GetAttributeTypeHandle(_reader).Resolve(_reader, new TypeContext(null, null)).ToType(); 73Type attributeType = attributeRuntimeTypeInfo.ToType(); 85expectedParameterTypes[index++] = parameterHandle.Resolve(reader, attributeRuntimeTypeInfo.TypeContext).ToType(); 143customAttributeTypedArgument = WrapInCustomAttributeTypedArgument(value, argumentType.ToType()); 184CustomAttributeTypedArgument typedValue = WrapInCustomAttributeTypedArgument(value, argumentType.ToType());
System\Reflection\Runtime\EventInfos\NativeFormat\NativeFormatRuntimeEventInfo.cs (1)
143return _event.Type.Resolve(_reader, ContextTypeInfo.TypeContext).ToType();
System\Reflection\Runtime\EventInfos\RuntimeEventInfo.cs (2)
50return ContextTypeInfo.ToType(); 81return ReflectedTypeInfo.ToType();
System\Reflection\Runtime\FieldInfos\NativeFormat\NativeFormatRuntimeFieldInfo.cs (2)
89return FieldRuntimeType.ToType().FormatTypeName() + " " + this.Name; 162public sealed override Type GetModifiedFieldType() => ModifiedType.Create(FieldRuntimeType.ToType(), _reader, FieldTypeHandle);
System\Reflection\Runtime\FieldInfos\RuntimeFieldInfo.cs (3)
77return _contextTypeInfo.ToType(); 88_lazyFieldType = fieldType = this.FieldRuntimeType.ToType(); 128return _reflectedType.ToType();
System\Reflection\Runtime\General\Helpers.cs (3)
48types[i] = typeInfos[i].ToType(); 122MethodInfo? invokeMethod = delegateType.ToType().GetMethod("Invoke", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly); 127throw ReflectionCoreExecution.ExecutionEnvironment.CreateMissingMetadataException(delegateType.ToType());
System\Reflection\Runtime\General\LegacyCustomAttributeApis.cs (3)
215public object[] GetCustomAttributes(bool inherit) => CustomAttributeExtensions.GetCustomAttributes(this.ToType(), inherit).ToArray(); 220IEnumerable<CustomAttributeData> cads = this.ToType().GetMatchingCustomAttributes(attributeType, inherit: inherit, skipTypeValidation: true); 227IEnumerable<CustomAttributeData> cads = this.ToType().GetMatchingCustomAttributes(attributeType, inherit: inherit, skipTypeValidation: true);
System\Reflection\Runtime\General\MetadataReaderExtensions.NativeFormat.cs (4)
88Type customModifier = modifiedType.ModifierType.Resolve(reader, typeContext).ToType(); 150Type? enumType = record.Type.TryResolve(reader, new TypeContext(null, null), ref exception)?.ToType(); 314Type? type = handle.TryResolve(reader, new TypeContext(null, null), ref exception)?.ToType(); 423Type? elementType = enumArray.ElementType.TryResolve(reader, new TypeContext(null, null), ref exception)?.ToType();
System\Reflection\Runtime\General\QSignatureTypeHandle.cs (1)
66return ModifiedType.Create(Resolve(typeContext).ToType(), (global::Internal.Metadata.NativeFormat.MetadataReader)Reader, _handle);
System\Reflection\Runtime\MethodInfos\RuntimeMethodInfo.cs (2)
96return this.RuntimeDeclaringType.ToType(); 395return CreateDelegateWithoutSignatureValidation(runtimeDelegateType.ToType(), target, isStatic: isStatic, isOpen: isOpen);
System\Reflection\Runtime\MethodInfos\RuntimeNamedMethodInfo.cs (1)
181return _reflectedType.ToType();
System\Reflection\Runtime\MethodInfos\RuntimePlainConstructorInfo.cs (1)
74return _common.DeclaringType.ToType();
System\Reflection\Runtime\MethodInfos\RuntimeSyntheticConstructorInfo.cs (2)
59return _declaringType.ToType(); 161protected sealed override MethodBaseInvoker UncachedMethodInvoker => new CustomMethodInvoker(_declaringType.ToType(), _runtimeParameterTypes.ToTypeArray(), _options, _action);
System\Reflection\Runtime\MethodInfos\RuntimeSyntheticMethodInfo.cs (1)
174protected sealed override MethodBaseInvoker UncachedMethodInvoker => new CustomMethodInvoker(_declaringType.ToType(), _runtimeParameterTypes.ToTypeArray(), _options, _action);
System\Reflection\Runtime\ParameterInfos\RuntimeMethodParameterInfo.cs (1)
35return _lazyParameterType ??= QualifiedParameterTypeHandle.Resolve(_typeContext).ToType();
System\Reflection\Runtime\ParameterInfos\RuntimeSyntheticParameterInfo.cs (1)
83return _parameterType.ToType();
System\Reflection\Runtime\PropertyInfos\RuntimePropertyInfo.cs (3)
72return ContextTypeInfo.ToType(); 164_lazyPropertyType = propertyType = PropertyTypeHandle.Resolve(typeContext).ToType(); 175return _reflectedType.ToType();
System\Reflection\Runtime\TypeInfos\NativeFormat\NativeFormatRuntimeNamedTypeInfo.cs (3)
117return this.ToType(); 204return (this.ToType() == typeof(Nullable<>)) ? RuntimeGenericTypeParameters[0].ToType() : null;
System\Reflection\Runtime\TypeInfos\NativeFormat\NativeFormatRuntimeTypeInfo.CoreGetDeclared.cs (1)
91yield return nestedTypeHandle.GetNamedType(_reader).ToType();
System\Reflection\Runtime\TypeInfos\RuntimeConstructedGenericTypeInfo.cs (3)
85return GenericTypeDefinitionTypeInfo.ToType(); 89GenericTypeDefinitionTypeInfo.ToType() == typeof(Nullable<>) 90? _key.GenericTypeArguments[0].ToType()
System\Reflection\Runtime\TypeInfos\RuntimeFunctionPointerTypeInfo.cs (1)
76public override Type GetFunctionPointerReturnType() => _key.ReturnType.ToType();
System\Reflection\Runtime\TypeInfos\RuntimeGenericParameterTypeInfo.cs (1)
69return ToType().Equals(other);
System\Reflection\Runtime\TypeInfos\RuntimeTypeDefinitionTypeInfo.cs (1)
31return ToType().Equals(other);
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.cs (21)
214ReflectionCoreExecution.ExecutionEnvironment.GetInterfaceMap(this.ToType(), interfaceType, out MethodInfo[] interfaceMethods, out MethodInfo[] targetMethods); 218im.TargetType = this.ToType(); 264return ToType().GetInterfaces(); 274Type ifc = directlyImplementedInterface.Resolve(typeContext).ToType(); 328return Assignability.IsAssignableFrom(this.ToType(), typeInfo); 381return InternalRuntimeElementType?.ToType(); 414return this.GetArrayType().ToType(); 421return this.GetMultiDimArrayType(rank).ToType(); 438return Type.MakeFunctionPointerSignatureType(this.ToType(), parameterTypes, isUnmanaged); 446return this.GetFunctionPointerType(runtimeParameterTypes, isUnmanaged).ToType(); 451return this.GetPointerType().ToType(); 456return this.GetByRefType().ToType(); 496return new SignatureConstructedGenericType(this.ToType(), typeArguments); 510return this.GetConstructedGenericType(runtimeTypeArguments!).ToType(); 517return this.InternalDeclaringType?.ToType(); 545throw ReflectionCoreExecution.ExecutionEnvironment.CreateMissingMetadataException(this.ToType()); 762return baseType?.ToType(); 769for (Type type = this.ToType(); type != null; type = type.BaseType!) 819baseType = baseTypeDef.Resolve().ToType(); 846if (baseType == valueType && this.ToType() != enumType) 849if (IsPrimitiveType(this.ToType()))
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.InvokeMember.cs (1)
88return Activator.CreateInstance(this.ToType(), bindingFlags, binder, providedArgs, culture);