42 [RequiresUnreferencedCode(
"Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
48 [RequiresUnreferencedCode(
"The built-in EventDescriptor implementation uses Reflection which requires unreferenced code.")]
54 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
60 [RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed.")]
71 [RequiresUnreferencedCode(
"The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
77 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
83 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
102 [
return: NotNullIfNotNull(
"instance")]
105 if (objectType ==
null)
109 if (instance ==
null)
140 attributes.
CopyTo(array2, 0);
141 for (
int i = 0; i < attributeArray.Length; i++)
144 for (
int j = 0; j < attributes.
Count; j++)
149 array2[j] = attributeArray[i];
155 array2[
count++] = attributeArray[i];
158 if (
count < array2.Length)
174 : base(existingProvider)
199 if (
_filter.Length != filter.Length)
203 for (
int i = 0; i < filter.Length; i++)
255 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2072:UnrecognizedReflectionPattern", Justification =
"The trimmer can't find the ComNativeDescriptor type when System.Windows.Forms isn't available. When System.Windows.Forms is available, the type will be seen by the trimmer and the ctor will be preserved.")]
258 Type type =
Type.
GetType(
"System.Windows.Forms.ComponentModel.Com2Interop.ComNativeDescriptor, System.Windows.Forms", throwOnError:
true);
262 [
return: NotNullIfNotNull(
"instance")]
296 [RequiresUnreferencedCode(
"Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
302 [RequiresUnreferencedCode(
"The built-in EventDescriptor implementation uses Reflection which requires unreferenced code.")]
308 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
314 [RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed.")]
317 if (editorBaseType ==
null)
329 [RequiresUnreferencedCode(
"The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
335 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
341 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
345 if (properties ==
null)
366 [RequiresUnreferencedCode(
"The Type of instance cannot be statically discovered.")]
373 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The ctor of this Type has RequiresUnreferencedCode.")]
379 return reflectTypeDescriptionProvider.GetExtendedAttributes(
_instance);
382 if (extendedTypeDescriptor ==
null)
387 if (attributes ==
null)
394 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The ctor of this Type has RequiresUnreferencedCode.")]
400 return reflectTypeDescriptionProvider.GetExtendedClassName(
_instance);
403 if (extendedTypeDescriptor ==
null)
410 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The ctor of this Type has RequiresUnreferencedCode.")]
416 return reflectTypeDescriptionProvider.GetExtendedComponentName(
_instance);
419 if (extendedTypeDescriptor ==
null)
426 [RequiresUnreferencedCode(
"Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
432 return reflectTypeDescriptionProvider.GetExtendedConverter(
_instance);
435 if (extendedTypeDescriptor ==
null)
447 [RequiresUnreferencedCode(
"The built-in EventDescriptor implementation uses Reflection which requires unreferenced code.")]
453 return reflectTypeDescriptionProvider.GetExtendedDefaultEvent(
_instance);
456 if (extendedTypeDescriptor ==
null)
463 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
469 return reflectTypeDescriptionProvider.GetExtendedDefaultProperty(
_instance);
472 if (extendedTypeDescriptor ==
null)
479 [RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed.")]
482 if (editorBaseType ==
null)
489 return reflectTypeDescriptionProvider.GetExtendedEditor(
_instance, editorBaseType);
492 if (extendedTypeDescriptor ==
null)
496 return extendedTypeDescriptor.
GetEditor(editorBaseType);
499 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The ctor of this Type has RequiresUnreferencedCode.")]
505 return reflectTypeDescriptionProvider.GetExtendedEvents(
_instance);
508 if (extendedTypeDescriptor ==
null)
520 [RequiresUnreferencedCode(
"The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
526 return reflectTypeDescriptionProvider.GetExtendedEvents(
_instance);
529 if (extendedTypeDescriptor ==
null)
541 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
547 return reflectTypeDescriptionProvider.GetExtendedProperties(
_instance);
550 if (extendedTypeDescriptor ==
null)
555 if (properties ==
null)
562 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
568 return reflectTypeDescriptionProvider.GetExtendedProperties(
_instance);
571 if (extendedTypeDescriptor ==
null)
576 if (properties ==
null)
583 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The ctor of this Type has RequiresUnreferencedCode.")]
589 return reflectTypeDescriptionProvider.GetExtendedPropertyOwner(
_instance, pd);
592 if (extendedTypeDescriptor ==
null)
622 attributes = reflectTypeDescriptionProvider.GetAttributes(
_objectType);
627 if (typeDescriptor ==
null)
632 if (attributes ==
null)
645 return reflectTypeDescriptionProvider.GetClassName(
_objectType);
648 if (typeDescriptor ==
null)
663 if (typeDescriptor ==
null)
670 [RequiresUnreferencedCode(
"Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
682 if (typeDescriptor ==
null)
695 [RequiresUnreferencedCode(
"The built-in EventDescriptor implementation uses Reflection which requires unreferenced code.")]
704 if (typeDescriptor ==
null)
711 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
720 if (typeDescriptor ==
null)
727 [RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed.")]
730 if (editorBaseType ==
null)
740 if (typeDescriptor ==
null)
744 return typeDescriptor.
GetEditor(editorBaseType);
753 events = reflectTypeDescriptionProvider.GetEvents(
_objectType);
758 if (typeDescriptor ==
null)
771 [RequiresUnreferencedCode(
"The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
778 events = reflectTypeDescriptionProvider.GetEvents(
_objectType);
783 if (typeDescriptor ==
null)
787 events = typeDescriptor.
GetEvents(attributes);
796 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
803 properties = reflectTypeDescriptionProvider.GetProperties(
_objectType);
808 if (typeDescriptor ==
null)
813 if (properties ==
null)
821 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
828 properties = reflectTypeDescriptionProvider.GetProperties(
_objectType);
833 if (typeDescriptor ==
null)
838 if (properties ==
null)
854 if (typeDescriptor ==
null)
873 if (objectType ==
null)
877 if (argTypes !=
null)
883 if (argTypes.Length != args.Length)
888 return Provider.CreateInstance(provider, objectType, argTypes, args);
893 if (instance ==
null)
897 return Provider.GetCache(instance);
900 [RequiresUnreferencedCode(
"The Type of instance cannot be statically discovered.")]
903 if (instance ==
null)
912 if (instance ==
null)
916 return Provider.GetExtenderProviders(instance);
919 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
922 if (component ==
null)
926 return Provider.GetFullComponentName(component);
932 if (objectType ==
null)
936 return Provider.GetReflectionType(objectType, instance);
941 if (objectType ==
null)
945 return Provider.GetRuntimeType(objectType);
950 if (objectType ==
null)
967 return Provider.IsSupportedType(
type);
1041 [Obsolete(
"TypeDescriptor.ComNativeDescriptorHandler has been deprecated. Use a type description provider to supply type information for COM types instead.")]
1051 typeDescriptionNode = typeDescriptionNode.
Next;
1053 while (typeDescriptionNode !=
null && comNativeDescriptionProvider ==
null);
1054 return comNativeDescriptionProvider?.
Handler;
1056 [param: DisallowNull]
1062 typeDescriptionNode = typeDescriptionNode.
Next;
1064 if (typeDescriptionNode ==
null)
1084 if (attributes ==
null)
1091 return typeDescriptionProvider;
1097 if (instance ==
null)
1101 if (attributes ==
null)
1108 return typeDescriptionProvider;
1112 [RequiresUnreferencedCode(
"The Types specified in table may be trimmed, or have their static construtors trimmed.")]
1121 if (provider ==
null)
1145 if (provider ==
null)
1149 if (instance ==
null)
1167 Refresh(instance, refreshReflectionProvider:
false);
1174 if (provider ==
null)
1188 if (provider ==
null)
1192 if (instance ==
null)
1215 for (
int num = customAttributes.Length - 1; num >= 0; num--)
1229 if (baseType !=
null && baseType !=
type)
1239 if (primary ==
null)
1243 if (secondary ==
null)
1247 if (primary == secondary)
1255 lock (associationTable)
1257 list = (
IList)associationTable[primary];
1267 for (
int num =
list.Count - 1; num >= 0; num--)
1270 if (weakReference.
IsAlive && weakReference.
Target == secondary)
1294 if (objectType ==
null)
1298 if (argTypes !=
null)
1304 if (argTypes.Length != args.Length)
1312 obj = typeDescriptionProvider.CreateInstance(provider, objectType, argTypes, args);
1314 return obj ??
NodeFor(objectType).CreateInstance(provider, objectType, argTypes, args);
1317 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
1323 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
1337 [RequiresUnreferencedCode(
"The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
1342 for (
int i = 0; i <
count; i++)
1345 for (
int j = 0; j < attributes.Length; j++)
1355 if (arrayList ==
null)
1358 for (
int k = 0; k < i; k++)
1360 arrayList.
Add(members[k]);
1366 arrayList?.
Add(members[i]);
1379 if (primary ==
null)
1383 object obj = primary;
1384 if (!
type.IsInstanceOfType(primary))
1391 for (
int num =
list.Count - 1; num >= 0; num--)
1394 object target = weakReference.
Target;
1399 else if (
type.IsInstanceOfType(target))
1408 ISite site = component.Site;
1411 object designer = designerHost.GetDesigner(component);
1412 if (designer !=
null &&
type.IsInstanceOfType(designer))
1424 if (componentType ==
null)
1428 return GetDescriptor(componentType,
"componentType").GetAttributes();
1431 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1438 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1441 if (component ==
null)
1449 if (noCustomTypeDesc)
1452 if (extendedDescriptor !=
null)
1468 if (extendedDescriptor2 !=
null)
1476 if (attributeCollection ==
null)
1482 return attributeCollection;
1487 return NodeFor(instance).GetCache(instance);
1490 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1493 return GetClassName(component, noCustomTypeDesc:
false);
1497 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1498 public static string?
GetClassName(
object component,
bool noCustomTypeDesc)
1500 return GetDescriptor(component, noCustomTypeDesc).GetClassName();
1505 return GetDescriptor(componentType,
"componentType").GetClassName();
1508 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1515 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1518 return GetDescriptor(component, noCustomTypeDesc).GetComponentName();
1521 [RequiresUnreferencedCode(
"Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All. The Type of component cannot be statically discovered.")]
1524 return GetConverter(component, noCustomTypeDesc:
false);
1528 [RequiresUnreferencedCode(
"Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All. The Type of component cannot be statically discovered.")]
1531 return GetDescriptor(component, noCustomTypeDesc).GetConverter();
1534 [RequiresUnreferencedCode(
"Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
1540 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The callers of this method ensure getting the converter is trim compatible - i.e. the type is not Nullable<T>.")]
1546 [RequiresUnreferencedCode(
"Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
1552 [RequiresUnreferencedCode(
"The built-in EventDescriptor implementation uses Reflection which requires unreferenced code.")]
1555 if (componentType ==
null)
1559 return GetDescriptor(componentType,
"componentType").GetDefaultEvent();
1562 [RequiresUnreferencedCode(
"The built-in EventDescriptor implementation uses Reflection which requires unreferenced code. The Type of component cannot be statically discovered.")]
1569 [RequiresUnreferencedCode(
"The built-in EventDescriptor implementation uses Reflection which requires unreferenced code. The Type of component cannot be statically discovered.")]
1572 if (component ==
null)
1576 return GetDescriptor(component, noCustomTypeDesc).GetDefaultEvent();
1579 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
1582 if (componentType ==
null)
1586 return GetDescriptor(componentType,
"componentType").GetDefaultProperty();
1589 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The Type of component cannot be statically discovered.")]
1596 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The Type of component cannot be statically discovered.")]
1599 if (component ==
null)
1603 return GetDescriptor(component, noCustomTypeDesc).GetDefaultProperty();
1615 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1618 if (component ==
null)
1624 if (!noCustomTypeDesc && customTypeDescriptor2 !=
null)
1628 return customTypeDescriptor;
1631 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1634 if (component ==
null)
1638 return NodeFor(component).GetExtendedTypeDescriptor(component);
1641 [RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed. The Type of component cannot be statically discovered.")]
1644 return GetEditor(component, editorBaseType, noCustomTypeDesc:
false);
1648 [RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed. The Type of component cannot be statically discovered.")]
1649 public static object?
GetEditor(
object component,
Type editorBaseType,
bool noCustomTypeDesc)
1651 if (editorBaseType ==
null)
1655 return GetDescriptor(component, noCustomTypeDesc).GetEditor(editorBaseType);
1658 [RequiresUnreferencedCode(
"Editors registered in TypeDescriptor.AddEditorTable may be trimmed.")]
1661 if (editorBaseType ==
null)
1670 if (componentType ==
null)
1674 return GetDescriptor(componentType,
"componentType").GetEvents();
1677 [RequiresUnreferencedCode(
"The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
1680 if (componentType ==
null)
1685 if (attributes !=
null && attributes.Length != 0)
1688 if (arrayList !=
null)
1695 return eventDescriptorCollection;
1698 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1701 return GetEvents(component,
null, noCustomTypeDesc:
false);
1705 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1708 return GetEvents(component,
null, noCustomTypeDesc);
1711 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
1714 return GetEvents(component, attributes, noCustomTypeDesc:
false);
1718 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
1721 if (component ==
null)
1730 if (noCustomTypeDesc)
1733 if (extendedDescriptor !=
null)
1751 if (extendedDescriptor2 !=
null)
1760 if (eventDescriptorCollection ==
null)
1766 return eventDescriptorCollection;
1771 string result =
null;
1773 if (extenderProvider !=
null)
1776 if (extenderProvider is
IComponent { Site: not
null } component)
1778 text = component.Site.Name;
1780 if (
text ==
null ||
text.Length == 0)
1784 result =
"_" +
text;
1789 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
1792 if (component ==
null)
1796 return GetProvider(component).GetFullComponentName(component);
1812 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered.")]
1815 if (componentType ==
null)
1819 return GetDescriptor(componentType,
"componentType").GetProperties();
1822 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
1825 if (componentType ==
null)
1830 if (attributes !=
null && attributes.Length != 0)
1833 if (arrayList !=
null)
1840 return propertyDescriptorCollection;
1843 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The Type of component cannot be statically discovered.")]
1850 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The Type of component cannot be statically discovered.")]
1853 return GetPropertiesImpl(component,
null, noCustomTypeDesc, noAttributes:
true);
1856 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
1859 return GetProperties(component, attributes, noCustomTypeDesc:
false);
1862 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
1865 return GetPropertiesImpl(component, attributes, noCustomTypeDesc, noAttributes:
false);
1868 [RequiresUnreferencedCode(
"PropertyDescriptor's PropertyType cannot be statically discovered. The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
1871 if (component ==
null)
1880 if (noCustomTypeDesc)
1883 if (extendedDescriptor !=
null)
1901 if (extendedDescriptor2 !=
null)
1910 if (propertyDescriptorCollection ==
null)
1916 return propertyDescriptorCollection;
1932 if (instance ==
null)
1936 return NodeFor(instance, createDelegator:
true);
1956 [RequiresUnreferencedCode(
"GetReflectionType is not trim compatible because the Type of object cannot be statically discovered.")]
1959 if (instance ==
null)
1963 return NodeFor(instance).GetReflectionType(instance);
1976 while (typeDescriptionNode ==
null)
1979 if (typeDescriptionNode !=
null)
1984 if (type2 == typeof(
object) || nodeForBaseType ==
null)
1989 if (typeDescriptionNode ==
null)
1996 else if (createDelegator)
2006 type2 = nodeForBaseType;
2009 return typeDescriptionNode;
2014 return NodeFor(instance, createDelegator:
false);
2020 if (typeDescriptionNode ==
null)
2023 if (
type.IsCOMObject)
2029 return typeDescriptionNode;
2039 while (typeDescriptionNode2 !=
null && typeDescriptionNode2.
Provider != provider)
2041 typeDescriptionNode3 = typeDescriptionNode2;
2042 typeDescriptionNode2 = typeDescriptionNode2.
Next;
2044 if (typeDescriptionNode2 ==
null)
2048 if (typeDescriptionNode2.
Next !=
null)
2050 typeDescriptionNode2.Provider = typeDescriptionNode2.
Next.
Provider;
2051 typeDescriptionNode2.Next = typeDescriptionNode2.
Next.
Next;
2057 else if (typeDescriptionNode2 != typeDescriptionNode)
2070 [RequiresUnreferencedCode(
"The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
2074 if (filter ==
null || filter.Length == 0)
2080 return attributeFilterCacheItem.FilteredMembers;
2082 if (
list ==
null ||
list.IsReadOnly)
2087 if (arrayList !=
null)
2094 switch (pipelineType)
2099 list.CopyTo(array2, 0);
2111 filteredMembers =
null;
2130 if (typeDescriptorFilterService ==
null)
2136 return filterCacheItem.FilteredMembers;
2140 switch (pipelineType)
2145 orderedDictionary[member.
TypeId] = member;
2147 flag = typeDescriptorFilterService.
FilterAttributes(component, orderedDictionary);
2153 string name = member2.
Name;
2154 if (orderedDictionary.
Contains(name))
2157 if (extenderCollisionSuffix !=
null)
2159 orderedDictionary[name + extenderCollisionSuffix] = member2;
2163 if (extenderCollisionSuffix !=
null)
2165 orderedDictionary.
Remove(name);
2166 orderedDictionary[memberDescriptor2.Name + extenderCollisionSuffix] = memberDescriptor2;
2171 orderedDictionary[name] = member2;
2174 flag = ((pipelineType != 1) ? typeDescriptorFilterService.
FilterEvents(component, orderedDictionary) : typeDescriptorFilterService.
FilterProperties(component, orderedDictionary));
2180 if (
list ==
null ||
list.IsReadOnly)
2187 foreach (
object value2
in orderedDictionary.
Values)
2192 if (flag && cache !=
null)
2195 switch (pipelineType)
2202 list.CopyTo(array2, 0);
2216 list.CopyTo(array3, 0);
2240 filteredMembers =
null;
2281 if (secondary ==
null || secondary.
Count == 0)
2316 foreach (
object item in primary)
2318 arrayList.Add(
item);
2320 foreach (
object item2
in secondary)
2322 arrayList.Add(item2);
2327 switch (pipelineType)
2332 arrayList.CopyTo(array3, 0);
2339 arrayList.CopyTo(array2, 0);
2346 arrayList.CopyTo(
array, 0);
2373 Refresh(component, refreshReflectionProvider:
true);
2376 private static void Refresh(
object component,
bool refreshReflectionProvider)
2378 if (component ==
null)
2383 if (refreshReflectionProvider)
2393 if ((!(type2 !=
null) || !
type.IsAssignableFrom(type2)) && !(type2 == typeof(
object)))
2401 typeDescriptionNode = typeDescriptionNode.
Next;
2403 if (typeDescriptionNode !=
null)
2416 if (!flag && cache ==
null)
2447 if ((!(type2 !=
null) || !
type.IsAssignableFrom(type2)) && !(type2 == typeof(
object)))
2455 typeDescriptionNode = typeDescriptionNode.
Next;
2457 if (typeDescriptionNode !=
null)
2489 if ((!(
type !=
null) || !
type.Module.Equals(module)) && !(
type == typeof(
object)))
2496 if (hashtable ==
null)
2501 typeDescriptionNode = typeDescriptionNode.
Next;
2503 if (typeDescriptionNode ==
null)
2512 reflectTypeDescriptionProvider.Refresh(type2);
2513 if (hashtable ==
null)
2517 hashtable[type2] = type2;
2525 foreach (
Type key in hashtable.Keys)
2533 if (!(assembly ==
null))
2536 foreach (
Module module
in modules)
2543 [RequiresUnreferencedCode(
"The Type of component cannot be statically discovered.")]
2549 for (
int i = 0; i < attributes.
Count; i++)
2556 if (type2 !=
null && type2 == designerBaseType)
2561 if (typeResolutionService !=
null)
2564 type = typeResolutionService.
GetType(designerAttribute.DesignerTypeName);
2586 if (primary ==
null)
2590 if (secondary ==
null)
2601 for (
int num =
list.Count - 1; num >= 0; num--)
2604 object target = weakReference.
Target;
2605 if (target ==
null || target == secondary)
2616 if (primary ==
null)
2626 if (provider ==
null)
2641 if (provider ==
null)
2645 if (instance ==
null)
2656 if (provider ==
null)
2670 if (provider ==
null)
2674 if (instance ==
null)
2681 [RequiresUnreferencedCode(
"The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
2684 if (member ==
null || attribute ==
null)
2689 if (attribute2 ==
null)
2693 return !attribute.
Match(attribute2);
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)
override bool Equals([NotNullWhen(true)] object? obj)
virtual bool Match(object? obj)
virtual bool IsDefaultAttribute()
virtual int Add(object? value)
static ArrayList Adapter(IList list)
virtual void CopyTo(Array array)
bool Contains(object key)
void CopyTo(Array array, int index)
void Remove(EventDescriptor? value)
PropertyDescriptor? ExtenderProperty
virtual AttributeCollection Attributes
static void AddEditorTable(Type editorBaseType, Hashtable table)
Type[] GetPopulatedTypes(Module module)
bool IsPopulated(Type type)
virtual ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance)
TypeDescriptionProvider()
ICustomTypeDescriptor? GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType)
readonly ICollection FilteredMembers
AttributeFilterCacheItem(Attribute[] filter, ICollection filteredMembers)
bool IsValid(Attribute[] filter)
readonly Attribute[] _filter
override AttributeCollection GetAttributes()
readonly Attribute[] _attributeArray
AttributeTypeDescriptor(Attribute[] attrs, ICustomTypeDescriptor parent)
AttributeProvider(TypeDescriptionProvider existingProvider, params Attribute[] attrs)
readonly Attribute[] _attrs
override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
ComNativeTypeDescriptor(IComNativeDescriptorHandler handler, object instance)
readonly IComNativeDescriptorHandler _handler
readonly object _instance
ComNativeDescriptionProvider(IComNativeDescriptorHandler handler)
IComNativeDescriptorHandler Handler
override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
readonly TypeDescriptionProvider _comNativeDescriptor
ComNativeDescriptorProxy()
override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
readonly ITypeDescriptorFilterService _filterService
bool IsValid(ITypeDescriptorFilterService filterService)
readonly ICollection FilteredMembers
FilterCacheItem(ITypeDescriptorFilterService filterService, ICollection filteredMembers)
static readonly MemberDescriptorComparer Instance
int Compare(object left, object right)
MergedTypeDescriptor(ICustomTypeDescriptor primary, ICustomTypeDescriptor secondary)
readonly ICustomTypeDescriptor _secondary
readonly ICustomTypeDescriptor _primary
override ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance)
override Type GetReflectionType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor|DynamicallyAccessedMemberTypes.PublicFields)] Type objectType, object instance)
override object CreateInstance(IServiceProvider provider, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, Type[] argTypes, object[] args)
override bool IsSupportedType(Type type)
override Type GetRuntimeType(Type objectType)
override string GetFullComponentName(object component)
override IDictionary GetCache(object instance)
override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
override IExtenderProvider[] GetExtenderProviders(object instance)
TypeDescriptionProvider Provider
TypeDescriptionNode(TypeDescriptionProvider provider)
static Type GetReflectionType(object instance)
static ICollection PipelineMerge(int pipelineType, ICollection primary, ICollection secondary, object instance, IDictionary cache)
static readonly object s_internalSyncObject
static void AddProvider(TypeDescriptionProvider provider, Type type)
static void AddProviderTransparent(TypeDescriptionProvider provider, object instance)
static void RemoveProvider(TypeDescriptionProvider provider, object instance)
static readonly Hashtable s_providerTypeTable
static readonly Guid[] s_pipelineMergeKeys
static readonly Guid[] s_pipelineFilterKeys
static int MetadataVersion
static PropertyDescriptor CreateProperty([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, PropertyDescriptor oldPropertyDescriptor, params Attribute[] attributes)
static ArrayList FilterMembers(IList members, Attribute[] attributes)
static readonly WeakHashtable s_providerTable
static PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static void RemoveAssociation(object primary, object secondary)
static PropertyDescriptorCollection GetPropertiesImpl(object component, Attribute[] attributes, bool noCustomTypeDesc, bool noAttributes)
static ? IDesigner CreateDesigner(IComponent component, Type designerBaseType)
static TypeDescriptionProvider GetProviderRecursive(Type type)
static AttributeCollection GetAttributes(object component)
static string GetExtenderCollisionSuffix(MemberDescriptor member)
static readonly Hashtable s_defaultProviders
static Type InterfaceType
static Type GetReflectionType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor|DynamicallyAccessedMemberTypes.PublicFields)] Type type)
static PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, Attribute[]? attributes)
static void CreateAssociation(object primary, object secondary)
static void Refresh(Type type)
static void AddProviderTransparent(TypeDescriptionProvider provider, Type type)
static TypeDescriptionNode NodeFor(object instance)
static WeakHashtable s_associationTable
static ICollection PipelineAttributeFilter(int pipelineType, ICollection members, Attribute[] filter, object instance, IDictionary cache)
static void Refresh(object component, bool refreshReflectionProvider)
static EventDescriptorCollection GetEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static ? object GetEditor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, Type editorBaseType)
static EventDescriptorCollection GetEvents(object component, Attribute[] attributes)
static TypeDescriptionNode NodeFor(object instance, bool createDelegator)
static EventDescriptor CreateEvent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, string name, Type type, params Attribute[] attributes)
static TypeDescriptionNode NodeFor(Type type)
static EventDescriptorCollection GetEvents(object component, bool noCustomTypeDesc)
static TypeConverter GetConverterTrimUnsafe([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
static ICollection PipelineInitialize(int pipelineType, ICollection members, IDictionary cache)
static TypeDescriptionProvider AddAttributes(object instance, params Attribute[] attributes)
static ? string GetClassName([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static PropertyDescriptorCollection GetProperties(object component)
static ? object GetEditor(object component, Type editorBaseType)
static void RemoveProvider(TypeDescriptionProvider provider, Type type)
static ? string GetClassName(object component)
static TypeConverter GetConverter([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
static TypeConverter GetConverter(object component)
static ? string GetFullComponentName(object component)
static void AddProvider(TypeDescriptionProvider provider, object instance)
static void NodeRemove(object key, TypeDescriptionProvider provider)
static object GetAssociation(Type type, object primary)
static AttributeCollection GetAttributes(object component, bool noCustomTypeDesc)
static ? object CreateInstance(IServiceProvider? provider, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, Type[]? argTypes, object[]? args)
static PropertyDescriptorCollection GetProperties(object component, Attribute[]? attributes, bool noCustomTypeDesc)
static TypeDescriptionNode NodeFor(Type type, bool createDelegator)
static void Refresh(Module module)
static ICustomTypeDescriptor GetDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string typeName)
static EventDescriptorCollection GetEvents(object component, Attribute[]? attributes, bool noCustomTypeDesc)
static PropertyDescriptorCollection GetProperties(object component, Attribute[]? attributes)
static ? EventDescriptor GetDefaultEvent(object component)
static readonly Guid[] s_pipelineAttributeFilterKeys
static readonly Guid[] s_pipelineInitializeKeys
static ? EventDescriptor GetDefaultEvent(object component, bool noCustomTypeDesc)
static void RemoveProviderTransparent(TypeDescriptionProvider provider, object instance)
static ? RefreshEventHandler Refreshed
static EventDescriptor CreateEvent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, EventDescriptor oldEventDescriptor, params Attribute[] attributes)
static void AddEditorTable(Type editorBaseType, Hashtable table)
static ICustomTypeDescriptor GetExtendedDescriptor(object component)
static Type ComObjectType
static void RemoveAssociations(object primary)
static void SortDescriptorArray(IList infos)
static ? EventDescriptor GetDefaultEvent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static ? string GetComponentName(object component)
static ICustomTypeDescriptor GetDescriptor(object component, bool noCustomTypeDesc)
static TypeDescriptionProvider GetProvider(Type type)
static void RaiseRefresh(object component)
static void CheckDefaultProvider(Type type)
static object ConvertFromInvariantString([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string stringValue)
static PropertyDescriptor CreateProperty([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, string name, Type type, params Attribute[] attributes)
static ? PropertyDescriptor GetDefaultProperty(object component)
static ICollection PipelineFilter(int pipelineType, ICollection members, object instance, IDictionary cache)
static EventDescriptorCollection GetEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, Attribute[] attributes)
static ? string GetClassName(object component, bool noCustomTypeDesc)
static ? IComNativeDescriptorHandler ComNativeDescriptorHandler
static ? PropertyDescriptor GetDefaultProperty([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static PropertyDescriptorCollection GetProperties(object component, bool noCustomTypeDesc)
static TypeDescriptionProvider GetProvider(object instance)
static AttributeCollection GetAttributes([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static int s_metadataVersion
static void Refresh(Assembly assembly)
static void RaiseRefresh(Type type)
static void RemoveProviderTransparent(TypeDescriptionProvider provider, Type type)
static EventDescriptorCollection GetEvents(object component)
static IDictionary GetCache(object instance)
static bool ShouldHideMember(MemberDescriptor member, Attribute attribute)
static void Refresh(object component)
static TypeConverter GetConverter(object component, bool noCustomTypeDesc)
static int s_collisionIndex
static ? string GetComponentName(object component, bool noCustomTypeDesc)
static TypeDescriptionProvider AddAttributes(Type type, params Attribute[] attributes)
static ? PropertyDescriptor GetDefaultProperty(object component, bool noCustomTypeDesc)
static ? object GetEditor(object component, Type editorBaseType, bool noCustomTypeDesc)
static Type GetNodeForBaseType(Type searchType)
static WeakHashtable AssociationTable
void SetWeak(object key, object value)
static CultureInfo InvariantCulture
static string TypeDescriptorAlreadyAssociated
static string ConvertToException
static string TypeDescriptorExpectedElementType
static string Format(string resourceFormat, object p1)
static string TypeDescriptorSameAssociation
static string TypeDescriptorArgsCountMismatch
static string TypeDescriptorProviderError
static int Increment(ref int location)
static bool Read(ref bool location)
virtual bool IsAssignableFrom([NotNullWhen(true)] Type? c)
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
virtual bool IsInstanceOfType([NotNullWhen(true)] object? o)
IEnumerator GetEnumerator()
bool FilterAttributes(IComponent component, IDictionary attributes)
bool FilterProperties(IComponent component, IDictionary properties)
bool FilterEvents(IComponent component, IDictionary events)
Type? GetType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string name)
AttributeCollection GetAttributes(object component)
PropertyDescriptor GetDefaultProperty(object component)
TypeConverter GetConverter(object component)
string GetClassName(object component)
EventDescriptor GetDefaultEvent(object component)
PropertyDescriptorCollection GetProperties(object component, Attribute[]? attributes)
EventDescriptorCollection GetEvents(object component)
object GetEditor(object component, Type baseEditorType)
object? GetEditor(Type editorBaseType)
EventDescriptor? GetDefaultEvent()
object? GetPropertyOwner(PropertyDescriptor? pd)
PropertyDescriptorCollection GetProperties()
PropertyDescriptor? GetDefaultProperty()
EventDescriptorCollection GetEvents()
string? GetComponentName()
TypeConverter GetConverter()
AttributeCollection GetAttributes()
object? GetService(Type serviceType)
delegate void RefreshEventHandler(RefreshEventArgs e)
DynamicallyAccessedMemberTypes
readonly object _instance
DefaultExtendedTypeDescriptor(TypeDescriptionNode node, object instance)
readonly TypeDescriptionNode _node
readonly object _instance
readonly Type _objectType
DefaultTypeDescriptor(TypeDescriptionNode node, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
readonly TypeDescriptionNode _node