70 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2062:UnrecognizedReflectionPattern", Justification =
"_type is annotated as preserve All members, so any Types returned from GetInterfaces should be preserved as well once https://github.com/mono/linker/issues/1731 is fixed.")]
115 list.RemoveRange(num,
list.Count - num);
137 [
RequiresUnreferencedCode(
"NullableConverter's UnderlyingType cannot be statically discovered. The Type of instance cannot be statically discovered.")]
141 if (instance !=
null)
183 if (instance !=
null)
192 [
RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The Type of instance cannot be statically discovered.")]
199 if (instance !=
null)
208 [
RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed. The Type of instance cannot be statically discovered.")]
212 if (instance !=
null)
263 int num = ((
_editorTypes ==
null) ? 4 : (_editorTypes.Length * 2));
265 object[]
array2 =
new object[num];
350 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"Calling _type.Assembly.GetType on a non-assembly qualified type will still work. See https://github.com/mono/linker/issues/1895")]
351 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2057:TypeGetType", Justification =
"Using the non-assembly qualified type name will still work.")]
354 if (
string.IsNullOrEmpty(typeName))
358 int num = typeName.IndexOf(
',');
368 if (
type ==
null && num != -1)
472 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"IntrinsicTypeConverters is marked with RequiresUnreferencedCode. It is the only place that should call this.")]
478 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2067:UnrecognizedReflectionPattern", Justification =
"Trimmer does not trim enums")]
492 [
RequiresUnreferencedCode(
"The Types specified in table may be trimmed, or have their static construtors trimmed.")]
512 if (argTypes !=
null)
521 for (
int i = 0; i <
args.Length; i++)
525 argTypes[i] =
args[i].GetType();
529 argTypes[i] =
typeof(
object);
577 return typeData.GetComponentName(instance);
580 [
RequiresUnreferencedCode(
"NullableConverter's UnderlyingType cannot be statically discovered. The Type of instance cannot be statically discovered.")]
584 return typeData.GetConverter(instance);
591 return typeData.GetDefaultEvent(instance);
594 [
RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The Type of instance cannot be statically discovered.")]
598 return typeData.GetDefaultProperty(instance);
601 [
RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed. The Type of instance cannot be statically discovered.")]
608 [
RequiresUnreferencedCode(
"The Types specified in EditorTables may be trimmed, or have their static construtors trimmed.")]
659 [
RequiresUnreferencedCode(
"The Type of instance cannot be statically discovered. NullableConverter's UnderlyingType cannot be statically discovered.")]
675 [
RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed. The Type of instance cannot be statically discovered.")]
744 if (instance ==
null)
826 if (
array2 !=
null && num > 0)
903 return list.ToArray();
959 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2057:TypeGetType", Justification =
"typeName is annotated with DynamicallyAccessedMembers, which will preserve the type. Using the non-assembly qualified type name will still work.")]
965 int num = typeName.IndexOf(
',');
974 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2067:UnrecognizedReflectionPattern", Justification =
"ReflectedTypeData is not being created here, just checking if was already created.")]
1042 if (num !=
array.Length)
1103 for (
int i = 0; i <
array.Length; i++)
1139 string name = propertyInfo.
Name;
1146 if (num !=
array.Length)
1158 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2067:UnrecognizedReflectionPattern", Justification =
"ReflectedTypeData is not being created here, just checking if was already created.")]
1174 if (
obj is string typeName)
1282 if ((
object)
type ==
null)
static ? object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture)
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
bool ContainsKey(TKey key)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
bool TryAdd(TKey key, TValue value)
Enumerator GetEnumerator()
void Add(TKey key, TValue value)
IEnumerator IEnumerable. GetEnumerator()
static readonly AttributeCollection Empty
static readonly EventDescriptorCollection Empty
static readonly PropertyDescriptorCollection Empty
IntrinsicTypeConverterData(Func< Type, TypeConverter > constructionFunc, bool cacheConverterInstance=true)
readonly Func< Type, TypeConverter > _constructionFunc
TypeConverter _converterInstance
TypeConverter GetOrCreateConverterInstance(Type innerType)
readonly bool _cacheConverterInstance
ReflectedTypeData([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
static EditorAttribute GetEditorAttribute(AttributeCollection attributes, Type editorBaseType)
EventDescriptor GetDefaultEvent(object instance)
PropertyDescriptor GetDefaultProperty(object instance)
Type GetTypeFromName([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] string typeName)
PropertyDescriptorCollection _properties
string GetClassName(object instance)
AttributeCollection _attributes
object GetEditor(object instance, Type editorBaseType)
PropertyDescriptorCollection GetProperties()
string GetComponentName(object instance)
AttributeCollection GetAttributes()
TypeConverter GetConverter(object instance)
EventDescriptorCollection _events
EventDescriptorCollection GetEvents()
static Hashtable s_editorTables
static object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, Type callingType)
string GetClassName([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
static Hashtable s_propertyCache
static readonly object s_internalSyncObject
static object GetIntrinsicTypeEditor(Hashtable table, Type callingType)
static Hashtable s_attributeCache
static void AddEditorTable(Type editorBaseType, Hashtable table)
static readonly Guid s_extenderProviderPropertiesKey
TypeConverter GetExtendedConverter(object instance)
ReflectTypeDescriptionProvider()
override ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance)
static Guid ExtenderProviderKey
object GetExtendedEditor(object instance, Type editorBaseType)
PropertyDescriptor GetExtendedDefaultProperty(object instance)
override Type GetReflectionType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor|DynamicallyAccessedMemberTypes.PublicFields)] Type objectType, object instance)
object GetPropertyOwner(Type type, object instance, PropertyDescriptor pd)
static EventDescriptor[] ReflectGetEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
static EnumConverter CreateEnumConverter(Type type)
static Attribute[] ReflectGetAttributes(Type type)
Type[] GetPopulatedTypes(Module module)
static readonly object s_dictionaryKey
static PropertyDescriptor[] ReflectGetExtendedProperties(IExtenderProvider provider)
EventDescriptor GetExtendedDefaultEvent(object instance)
static readonly Type[] s_skipInterfaceAttributeList
EventDescriptorCollection GetExtendedEvents(object instance)
static Dictionary< object, IntrinsicTypeConverterData > s_intrinsicTypeConverters
PropertyDescriptorCollection GetExtendedProperties(object instance)
static void ClearReflectionCaches()
bool IsPopulated(Type type)
static Hashtable EditorTables
static Hashtable s_extendedPropertyCache
static Dictionary< object, IntrinsicTypeConverterData > IntrinsicTypeConverters
EventDescriptorCollection GetEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
static Hashtable AttributeCache
TypeConverter GetConverter([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance)
static readonly Type[] s_typeConstructor
ReflectedTypeData GetTypeData([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, bool createIfNeeded)
EventDescriptor GetDefaultEvent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance)
override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
static readonly object s_intrinsicReferenceKey
static Hashtable GetEditorTable(Type editorBaseType)
static Attribute[] ReflectGetAttributes(MemberInfo member)
object GetEditor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance, Type editorBaseType)
static NullableConverter CreateNullableConverter(Type type)
PropertyDescriptor GetDefaultProperty([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance)
static PropertyDescriptor[] ReflectGetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
string GetComponentName([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance)
static Type GetTypeFromName([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string typeName)
string GetExtendedClassName(object instance)
object GetExtendedPropertyOwner(object instance, PropertyDescriptor pd)
override object CreateInstance(IServiceProvider provider, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, Type[] argTypes, object[] args)
override IExtenderProvider[] GetExtenderProviders(object instance)
static Hashtable PropertyCache
PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
static readonly Guid s_extenderPropertiesKey
static readonly object s_intrinsicNullableKey
AttributeCollection GetAttributes([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
string GetExtendedComponentName(object instance)
override IDictionary GetCache(object instance)
static Hashtable EventCache
static Hashtable ExtendedPropertyCache
override string GetFullComponentName(object component)
static IExtenderProvider[] GetExtenders(ICollection components, object instance, IDictionary cache)
AttributeCollection GetExtendedAttributes(object instance)
static TypeConverter GetIntrinsicTypeConverter(Type callingType)
static Hashtable s_eventCache
static PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static EventDescriptorCollection GetEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static object GetAssociation(Type type, object primary)
static ? string GetComponentName(object component)
static AttributeCollection GetAttributes([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static IDictionary GetCache(object instance)
virtual ? Type GetType(string name)
object[] GetCustomAttributes(bool inherit)
MethodInfo? GetGetMethod()
MethodInfo? GetSetMethod()
ParameterInfo[] GetIndexParameters()
static void RunClassConstructor(QCallTypeHandle type)
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
static readonly Type[] EmptyTypes
DynamicallyAccessedMemberTypes