This rule catches a couple different kinds of issues with attributes.

The first is that non-components should not have the Browsable, Category, DefaultValue, Description or DesignerSerializationVisibility attributes. These attributes have to do with the Property Grid and serialization in the WinForms designer. Non-components can't be used so the attributes should be removed.

The second is when Browsable(false) attribute is specified for a public field or property, the Category and Description attributes should be removed.

The third is when DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) attribute is specified for a public field or property, the DefaultValue attribute should be removed.

The forth is that any of the above should not be on anything but public fields or properties.

Last edited Mar 5, 2009 at 7:21 PM by JeffLeBert, version 2

Comments

No comments yet.