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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.