Applying Attributes

You have seen a lot of examples about applying attributes. This section provides explanation about applying attributes. When applying an attribute to your own type or member, you enclose the attribute name between angle brackets, as in the following example:

<Serializable()>Public Class PersonEnd Class

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

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 the Serializable attribute or that it is marked as Serializable. Attributes ...

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

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