Applying Attributes

Until now you have gotten a lot of examples about applying attributes, but for the sake of completeness we provide information here. When applying attributes to your own types or members, you enclose the attribute name between angle brackets, as in the following example:

image

In this case the Serializable attribute is parameterless (and in this case you can omit round parenthesis).

When you apply an attribute, your object is decorated with that attribute. Another common description utilized when applying attributes is that an object is marked. Referring to the previous example, you can say that the Person class is decorated with ...

Get Visual Basic 2010 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.