Next to manual data serialization, recognizing and reacting to custom attributes at runtime is probably the most frequent way of using reflection techniques. As mentioned earlier, attributes serve to mark classes or class elements. Attribute classes normally don’t have any real functionality, because only very rarely is their class code executed.
Open the corresponding solution (.sln), which you can find in the \VB 2010 Developer Handbook\Chapter 21\Reflection02 folder.
The code file mdlMain.vb contains the definition of an Attribute class, which appears as follows:
'Create custom attribute <AttributeUsage(AttributeTargets.All)> Public Class MyAttribute Inherits Attribute ...