13.07.2015 Views

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 24 Attributesend example][Help("http://www.mycompany.com/…/Misc.htm", Topic ="Class2")]class Class2{}24.1.3 Attribute parameter typesThe types of positional and named parameters for an attribute class are limited to the attribute parametertypes, which are:• One of the following types: bool, byte, char, double, float, int, long, short, string.• The type object.• The type System.Type.• An enum type, provided it has public accessibility and the types in which it is nested (if any) also havepublic accessibility.• Single-dimensional arrays of the above types.24.2 Attribute specificationAttribute specification is the application of a previously defined attribute to a declaration. An attribute is apiece of additional declarative information that is specified for a declaration. Attributes can be specified atglobal scope (to specify attributes on the containing assembly) and for type-declarations (§16.5), classmember-declarations(§17.2), struct-member-declarations (§18.2), interface-member-declarations (§20.2),enum-member-declarations (§21.1), accessor-declarations (§17.6.2), event-accessor-declarations (§17.7),and formal-parameter-lists (§17.5.1).Attributes are specified in attribute sections. An attribute section consists of a pair of square brackets, whichsurround a comma-separated list of one or more attributes. The order in which attributes are specified insuch a list, and the order in which sections attached to the same program entity are arranged, is notsignificant. For instance, the attribute specifications [A][B], [B][A], [A, B], and [B, A] are equivalent.global-attributes:global-attribute-sectionsglobal-attribute-sections:global-attribute-sectionglobal-attribute-sections global-attribute-sectionglobal-attribute-section:[ global-attribute-target-specifier attribute-list ][ global-attribute-target-specifier attribute-list , ]global-attribute-target-specifier:global-attribute-target :global-attribute-target:assemblyattributes:attribute-sectionsattribute-sections:attribute-sectionattribute-sections attribute-sectionattribute-section:[ attribute-target-specifier opt attribute-list ][ attribute-target-specifier opt attribute-list , ]307

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!