Declare Attribute CodeRush code provider
Attributes provide a powerful method of associating declarative information by decorating elements of the code, such as types, methods, properties, parameters and assemblies. Once an attribute is associated with a program entity, it can be queried at run time and used in various cases, for example, associating a help document with program entities (via the Help attribute), or marking an item as out of date (via the Obsolete attribute).
As the name says, the Declare Attribute code provider generates a new attribute class for an undeclared attribute reference:
It adds the appropriate AttributeUsage attribute for the newly declared attribute with the corresponding attribute target, which can be easily modified using the Text Fields CodeRush feature:
Simply press Enter when you are done with the name of the attribute and you will be navigated to the attribute target for further modification:
If the attribute target is valid, pressing the Enter key for the second time will move you inside the constructor of the class.—– Products: CodeRush Pro Versions: 12.1 and up VS IDEs: 2008 and up Updated: Sep/21/2012 ID: C167