1 override of
System.Windows.Forms (1)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.MergedAttributeCollection.cs (1)
22public override Attribute? this[[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields)] Type attributeType] => GetCommonAttribute(attributeType);
140 references to
PresentationFramework (10)
System\Windows\Markup\Primitives\ElementMarkupObject.cs (1)
127ConstructorArgumentAttribute constructorArgumentAttribute = descriptor.Attributes[typeof(ConstructorArgumentAttribute)] as ConstructorArgumentAttribute;
System\Windows\Markup\Primitives\MarkupWriter.cs (8)
480ContentPropertyAttribute cpa = item.Attributes[typeof(ContentPropertyAttribute)] as ContentPropertyAttribute; 481XmlLangPropertyAttribute xlpa = item.Attributes[typeof(XmlLangPropertyAttribute)] as XmlLangPropertyAttribute; 482UidPropertyAttribute upa = item.Attributes[typeof(UidPropertyAttribute)] as UidPropertyAttribute; 544if (property.Attributes[typeof(DesignerSerializationOptionsAttribute)] != null) 546DesignerSerializationOptionsAttribute option = property.Attributes[typeof(DesignerSerializationOptionsAttribute)] as DesignerSerializationOptionsAttribute; 1084if (attributes[typeof(ContentWrapperAttribute)] == null) 1103ContentPropertyAttribute cpa = item.Attributes[typeof(ContentPropertyAttribute)] as ContentPropertyAttribute; 1232TrimSurroundingWhitespaceAttribute attribute = item.Attributes[typeof(TrimSurroundingWhitespaceAttribute)] as TrimSurroundingWhitespaceAttribute;
System\Windows\Markup\XamlTypeMapper.cs (1)
1833XmlLangPropertyAttribute xlpa = attributes[typeof(XmlLangPropertyAttribute)] as XmlLangPropertyAttribute;
System.ComponentModel.TypeConverter (23)
System\ComponentModel\AttributeCollection.cs (1)
212Attribute? attr = this[attribute.GetType()];
System\ComponentModel\ExtendedPropertyDescriptor.cs (3)
49ExtenderProvidedPropertyAttribute? attr = extender.Attributes[typeof(ExtenderProvidedPropertyAttribute)] as ExtenderProvidedPropertyAttribute; 78public override bool IsReadOnly => Attributes[typeof(ReadOnlyAttribute)]!.Equals(ReadOnlyAttribute.Yes); 96if (!(Attributes[typeof(DisplayNameAttribute)] is DisplayNameAttribute displayNameAttr) || displayNameAttr.IsDefaultAttribute())
System\ComponentModel\MemberDescriptor.cs (5)
168public virtual string Category => _category ??= ((CategoryAttribute)Attributes[typeof(CategoryAttribute)]!).Category; 173public virtual string Description => _description ??= ((DescriptionAttribute)Attributes[typeof(DescriptionAttribute)]!).Description; 179public virtual bool IsBrowsable => ((BrowsableAttribute)Attributes[typeof(BrowsableAttribute)]!).Browsable; 195public virtual bool DesignTimeOnly => (DesignOnlyAttribute.Yes.Equals(Attributes[typeof(DesignOnlyAttribute)])); 204if (!(Attributes[typeof(DisplayNameAttribute)] is DisplayNameAttribute displayNameAttr) || displayNameAttr.IsDefaultAttribute())
System\ComponentModel\PropertyDescriptor.cs (4)
77TypeConverterAttribute attr = (TypeConverterAttribute)attrs[typeof(TypeConverterAttribute)]!; 106TypeConverterAttribute attr = (TypeConverterAttribute)attrs[typeof(TypeConverterAttribute)]!; 139public virtual bool IsLocalizable => (LocalizableAttribute.Yes.Equals(Attributes[typeof(LocalizableAttribute)])); 155DesignerSerializationVisibilityAttribute attr = (DesignerSerializationVisibilityAttribute)Attributes[typeof(DesignerSerializationVisibilityAttribute)]!;
System\ComponentModel\ReflectPropertyDescriptor.cs (3)
228Attribute? a = Attributes[typeof(AmbientValueAttribute)]; 297Attribute? a = Attributes[typeof(DefaultValueAttribute)]; 368public override bool IsReadOnly => SetMethodValue == null || ((ReadOnlyAttribute)Attributes[typeof(ReadOnlyAttribute)]!).IsReadOnly;
System\ComponentModel\ReflectTypeDescriptionProvider.cs (1)
610ExtenderProvidedPropertyAttribute? eppa = prop.Attributes[typeof(ExtenderProvidedPropertyAttribute)] as ExtenderProvidedPropertyAttribute;
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (2)
262DefaultEventAttribute? attr = (DefaultEventAttribute?)attributes[typeof(DefaultEventAttribute)]; 295DefaultPropertyAttribute? attr = (DefaultPropertyAttribute?)attributes[typeof(DefaultPropertyAttribute)];
System\ComponentModel\TypeConverter.cs (2)
387DefaultValueAttribute? attr = (DefaultValueAttribute?)Attributes[typeof(DefaultValueAttribute)]; 401DefaultValueAttribute? attr = (DefaultValueAttribute?)Attributes[typeof(DefaultValueAttribute)];
System\ComponentModel\TypeDescriptor.cs (2)
1273ExtenderProvidedPropertyAttribute? exAttr = member.Attributes[typeof(ExtenderProvidedPropertyAttribute)] as ExtenderProvidedPropertyAttribute; 2734Attribute? memberAttribute = member.Attributes[attribute.GetType()];
System.Data.Common (1)
System\Data\Common\DbConnectionStringBuilder.cs (1)
564Attribute? attr = property.Attributes[attribute.GetType()];
System.Windows.Forms (4)
System\Windows\Forms\ComponentModel\COM2Interop\COM2IVsPerPropertyBrowsingHandler.cs (1)
87BOOL hide = sender.Attributes[typeof(BrowsableAttribute)] is Attribute browsableAttribute
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (3)
351_readOnly |= Attributes[typeof(ReadOnlyAttribute)]?.Equals(ReadOnlyAttribute.Yes) ?? false; 487if (Attributes[typeof(TypeConverterAttribute)] is TypeConverterAttribute attribute) 525if (Attributes[typeof(EditorAttribute)] is EditorAttribute attribute)
System.Windows.Forms.Design (11)
System\ComponentModel\Design\ComponentDesigner.cs (1)
420if (Equals(prop.Attributes[typeof(DesignOnlyAttribute)], DesignOnlyAttribute.Yes))
System\ComponentModel\Design\EventBindingService.EventPropertyDescriptor.cs (1)
65public override bool IsReadOnly => Attributes[typeof(ReadOnlyAttribute)]!.Equals(ReadOnlyAttribute.Yes);
System\ComponentModel\Design\InheritedPropertyDescriptor.cs (1)
117public override bool IsReadOnly => _propertyDescriptor.IsReadOnly || Equals(Attributes[typeof(ReadOnlyAttribute)], ReadOnlyAttribute.Yes);
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifiersInheritedExtenderProvider.cs (1)
43if (!attributes[typeof(InheritanceAttribute)]!.Equals(InheritanceAttribute.NotInherited))
System\ComponentModel\Design\Serialization\LocalizationCodeDomSerializer.cs (1)
102ExtenderProvidedPropertyAttribute? attribute = descriptor.Attributes[typeof(ExtenderProvidedPropertyAttribute)] as ExtenderProvidedPropertyAttribute;
System\Windows\Forms\Design\ControlDesigner.cs (2)
950DockingAttribute? dockingAttribute = (DockingAttribute?)attributes[typeof(DockingAttribute)]; 1175DockingAttribute? dockingAttribute = (DockingAttribute?)attributes[typeof(DockingAttribute)];
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
1509ListBindableAttribute? listBindable = property.Attributes[typeof(ListBindableAttribute)] as ListBindableAttribute;
System\Windows\Forms\Design\ParentControlDesigner.cs (1)
971var sizeAttr = (DefaultValueAttribute)prop.Attributes[typeof(DefaultValueAttribute)];
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
1420DesignerSerializationVisibilityAttribute dsv = member.Attributes[typeof(DesignerSerializationVisibilityAttribute)] as DesignerSerializationVisibilityAttribute;
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (1)
575if (getProperty.Attributes[typeof(BrowsableAttribute)] is BrowsableAttribute attribute)
System.Windows.Forms.Design.Tests (2)
System\ComponentModel\Design\ComponentDesignerTests.cs (2)
2444Assert.True(Assert.IsType<ReadOnlyAttribute>(result.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 2884Assert.True(Assert.IsType<ReadOnlyAttribute>(result.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly);
System.Windows.Forms.Primitives (2)
System\ComponentModel\MemberDescriptorExtensions.cs (2)
13attribute = descriptor?.Attributes[typeof(T)] as T; 20=> descriptor?.Attributes[typeof(T)] as T;
System.Windows.Forms.Tests (85)
System\Windows\Forms\AxHost.AxPropertyDescriptorTests.cs (81)
26Assert.NotNull(property.Attributes[typeof(CustomAttribute)]); 27Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 28Assert.Equal("Misc", Assert.IsType<CategoryAttribute>(property.Attributes[typeof(CategoryAttribute)]).Category); 29Assert.Empty(Assert.IsType<DescriptionAttribute>(property.Attributes[typeof(DescriptionAttribute)]).Description); 30Assert.False(Assert.IsType<ReadOnlyAttribute>(property.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 31Assert.Null(property.Attributes[typeof(DispIdAttribute)]); 42Assert.Null(property.Attributes[typeof(CustomAttribute)]); 43Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 44Assert.Equal("Misc", Assert.IsType<CategoryAttribute>(property.Attributes[typeof(CategoryAttribute)]).Category); 45Assert.Empty(Assert.IsType<DescriptionAttribute>(property.Attributes[typeof(DescriptionAttribute)]).Description); 46Assert.False(Assert.IsType<ReadOnlyAttribute>(property.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 47Assert.Equal(PInvokeCore.DISPID_TEXT, Assert.IsType<DispIdAttribute>(property.Attributes[typeof(DispIdAttribute)]).Value); 58Assert.Null(property.Attributes[typeof(CustomAttribute)]); 59Assert.False(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 60Assert.Equal("Misc", Assert.IsType<CategoryAttribute>(property.Attributes[typeof(CategoryAttribute)]).Category); 61Assert.Empty(Assert.IsType<DescriptionAttribute>(property.Attributes[typeof(DescriptionAttribute)]).Description); 62Assert.False(Assert.IsType<ReadOnlyAttribute>(property.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 63Assert.Equal(PInvokeCore.DISPID_TEXT, Assert.IsType<DispIdAttribute>(property.Attributes[typeof(DispIdAttribute)]).Value); 74Assert.Null(property.Attributes[typeof(CustomAttribute)]); 75Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 76Assert.Equal("Misc", Assert.IsType<CategoryAttribute>(property.Attributes[typeof(CategoryAttribute)]).Category); 77Assert.Empty(Assert.IsType<DescriptionAttribute>(property.Attributes[typeof(DescriptionAttribute)]).Description); 78Assert.True(Assert.IsType<ReadOnlyAttribute>(property.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 79Assert.Equal(PInvokeCore.DISPID_TEXT, Assert.IsType<DispIdAttribute>(property.Attributes[typeof(DispIdAttribute)]).Value); 90Assert.Null(property.Attributes[typeof(CustomAttribute)]); 91Assert.False(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 92Assert.Equal("Misc", Assert.IsType<CategoryAttribute>(property.Attributes[typeof(CategoryAttribute)]).Category); 93Assert.Empty(Assert.IsType<DescriptionAttribute>(property.Attributes[typeof(DescriptionAttribute)]).Description); 94Assert.True(Assert.IsType<ReadOnlyAttribute>(property.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 95Assert.Equal(PInvokeCore.DISPID_TEXT, Assert.IsType<DispIdAttribute>(property.Attributes[typeof(DispIdAttribute)]).Value); 504Assert.NotNull(property.Attributes[typeof(CustomAttribute)]); 505Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 506Assert.Equal("Misc", Assert.IsType<CategoryAttribute>(property.Attributes[typeof(CategoryAttribute)]).Category); 507Assert.Empty(Assert.IsType<DescriptionAttribute>(property.Attributes[typeof(DescriptionAttribute)]).Description); 508Assert.False(Assert.IsType<ReadOnlyAttribute>(property.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 509Assert.Null(property.Attributes[typeof(DispIdAttribute)]); 528Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 547Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 572Assert.NotNull(property.Attributes[typeof(CustomAttribute)]); 573Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 574Assert.Equal("Misc", Assert.IsType<CategoryAttribute>(property.Attributes[typeof(CategoryAttribute)]).Category); 575Assert.Empty(Assert.IsType<DescriptionAttribute>(property.Attributes[typeof(DescriptionAttribute)]).Description); 576Assert.False(Assert.IsType<ReadOnlyAttribute>(property.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 577Assert.Null(property.Attributes[typeof(DispIdAttribute)]); 608Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 639Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 660Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 687Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 708Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 735Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 789Assert.NotNull(property.Attributes[typeof(CustomAttribute)]); 790Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 791Assert.Equal("Misc", Assert.IsType<CategoryAttribute>(property.Attributes[typeof(CategoryAttribute)]).Category); 792Assert.Empty(Assert.IsType<DescriptionAttribute>(property.Attributes[typeof(DescriptionAttribute)]).Description); 793Assert.False(Assert.IsType<ReadOnlyAttribute>(property.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 794Assert.Null(property.Attributes[typeof(DispIdAttribute)]); 811Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 828Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 854Assert.NotNull(property.Attributes[typeof(CustomAttribute)]); 855Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 856Assert.Equal("Misc", Assert.IsType<CategoryAttribute>(property.Attributes[typeof(CategoryAttribute)]).Category); 857Assert.Empty(Assert.IsType<DescriptionAttribute>(property.Attributes[typeof(DescriptionAttribute)]).Description); 858Assert.False(Assert.IsType<ReadOnlyAttribute>(property.Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly); 859Assert.Null(property.Attributes[typeof(DispIdAttribute)]); 888Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 917Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 946Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 975Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 993Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1018Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1037Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1062Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1089Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1114Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1139Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1162Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1187Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1210Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1238Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1264Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable); 1292Assert.True(Assert.IsType<BrowsableAttribute>(property.Attributes[typeof(BrowsableAttribute)]).Browsable);
System\Windows\Forms\AxHostTests.cs (4)
2334Assert.NotNull(attributes[typeof(CustomAttribute)]); 2339Assert.NotNull(attributes[typeof(CustomAttribute)]); 2357Assert.NotNull(attributes[typeof(CustomAttribute)]); 2365Assert.NotNull(attributes[typeof(CustomAttribute)]);
System.Xaml (2)
System\Windows\Markup\ValueSerializer.cs (2)
117if (attributes[typeof(ValueSerializerAttribute)] is ValueSerializerAttribute attribute) 167if (descriptor.Attributes[typeof(ValueSerializerAttribute)] is ValueSerializerAttribute serializerAttribute)