@@ -48,10 +48,10 @@ internal sealed partial class ReflectTypeDescriptionProvider : TypeDescriptionPr
48
48
// on Control, Component and object are also automatically filled
49
49
// in. The keys to the property and event caches are types.
50
50
// The keys to the attribute cache are either MemberInfos or types.
51
- private static ContextAwareHashtable ? s_propertyCache ;
52
- private static ContextAwareHashtable ? s_eventCache ;
53
- private static ContextAwareHashtable ? s_attributeCache ;
54
- private static ContextAwareHashtable ? s_extendedPropertyCache ;
51
+ private static CollectibleKeyHashtable ? s_propertyCache ;
52
+ private static CollectibleKeyHashtable ? s_eventCache ;
53
+ private static CollectibleKeyHashtable ? s_attributeCache ;
54
+ private static CollectibleKeyHashtable ? s_extendedPropertyCache ;
55
55
56
56
// These are keys we stuff into our object cache. We use this
57
57
// cache data to store extender provider info for an object.
@@ -192,13 +192,13 @@ private static Dictionary<object, IntrinsicTypeConverterData> IntrinsicTypeConve
192
192
Justification = "IntrinsicTypeConverters is marked with RequiresUnreferencedCode. It is the only place that should call this." ) ]
193
193
private static NullableConverter CreateNullableConverter ( Type type ) => new NullableConverter ( type ) ;
194
194
195
- private static ContextAwareHashtable PropertyCache => LazyInitializer . EnsureInitialized ( ref s_propertyCache , ( ) => new ContextAwareHashtable ( ) ) ;
195
+ private static CollectibleKeyHashtable PropertyCache => LazyInitializer . EnsureInitialized ( ref s_propertyCache , ( ) => new CollectibleKeyHashtable ( ) ) ;
196
196
197
- private static ContextAwareHashtable EventCache => LazyInitializer . EnsureInitialized ( ref s_eventCache , ( ) => new ContextAwareHashtable ( ) ) ;
197
+ private static CollectibleKeyHashtable EventCache => LazyInitializer . EnsureInitialized ( ref s_eventCache , ( ) => new CollectibleKeyHashtable ( ) ) ;
198
198
199
- private static ContextAwareHashtable AttributeCache => LazyInitializer . EnsureInitialized ( ref s_attributeCache , ( ) => new ContextAwareHashtable ( ) ) ;
199
+ private static CollectibleKeyHashtable AttributeCache => LazyInitializer . EnsureInitialized ( ref s_attributeCache , ( ) => new CollectibleKeyHashtable ( ) ) ;
200
200
201
- private static ContextAwareHashtable ExtendedPropertyCache => LazyInitializer . EnsureInitialized ( ref s_extendedPropertyCache , ( ) => new ContextAwareHashtable ( ) ) ;
201
+ private static CollectibleKeyHashtable ExtendedPropertyCache => LazyInitializer . EnsureInitialized ( ref s_extendedPropertyCache , ( ) => new CollectibleKeyHashtable ( ) ) ;
202
202
203
203
/// <summary>Clear the global caches this maintains on top of reflection.</summary>
204
204
internal static void ClearReflectionCaches ( )
@@ -1095,7 +1095,7 @@ internal bool IsPopulated(Type type)
1095
1095
/// </summary>
1096
1096
internal static Attribute [ ] ReflectGetAttributes ( Type type )
1097
1097
{
1098
- ContextAwareHashtable attributeCache = AttributeCache ;
1098
+ CollectibleKeyHashtable attributeCache = AttributeCache ;
1099
1099
Attribute [ ] ? attrs = ( Attribute [ ] ? ) attributeCache [ type ] ;
1100
1100
if ( attrs != null )
1101
1101
{
@@ -1123,7 +1123,7 @@ internal static Attribute[] ReflectGetAttributes(Type type)
1123
1123
/// </summary>
1124
1124
internal static Attribute [ ] ReflectGetAttributes ( MemberInfo member )
1125
1125
{
1126
- ContextAwareHashtable attributeCache = AttributeCache ;
1126
+ CollectibleKeyHashtable attributeCache = AttributeCache ;
1127
1127
Attribute [ ] ? attrs = ( Attribute [ ] ? ) attributeCache [ member ] ;
1128
1128
if ( attrs != null )
1129
1129
{
@@ -1151,7 +1151,7 @@ internal static Attribute[] ReflectGetAttributes(MemberInfo member)
1151
1151
/// </summary>
1152
1152
private static EventDescriptor [ ] ReflectGetEvents ( Type type )
1153
1153
{
1154
- ContextAwareHashtable eventCache = EventCache ;
1154
+ CollectibleKeyHashtable eventCache = EventCache ;
1155
1155
EventDescriptor [ ] ? events = ( EventDescriptor [ ] ? ) eventCache [ type ] ;
1156
1156
if ( events != null )
1157
1157
{
@@ -1251,7 +1251,7 @@ private static PropertyDescriptor[] ReflectGetExtendedProperties(IExtenderProvid
1251
1251
// property store.
1252
1252
//
1253
1253
Type providerType = provider . GetType ( ) ;
1254
- ContextAwareHashtable extendedPropertyCache = ExtendedPropertyCache ;
1254
+ CollectibleKeyHashtable extendedPropertyCache = ExtendedPropertyCache ;
1255
1255
ReflectPropertyDescriptor [ ] ? extendedProperties = ( ReflectPropertyDescriptor [ ] ? ) extendedPropertyCache [ providerType ] ;
1256
1256
if ( extendedProperties == null )
1257
1257
{
@@ -1336,7 +1336,7 @@ private static PropertyDescriptor[] ReflectGetPropertiesFromRegisteredType(Type
1336
1336
1337
1337
private static PropertyDescriptor [ ] ReflectGetPropertiesImpl ( Type type )
1338
1338
{
1339
- ContextAwareHashtable propertyCache = PropertyCache ;
1339
+ CollectibleKeyHashtable propertyCache = PropertyCache ;
1340
1340
PropertyDescriptor [ ] ? properties = ( PropertyDescriptor [ ] ? ) propertyCache [ type ] ;
1341
1341
if ( properties != null )
1342
1342
{
0 commit comments