■
Note
For security reasons, it is considered a .NET best practice to design all custom attributes as sealed. In
fact, Visual Studio 2008 provides a code snippet named
Attribute
that will dump out a new
System.
Attribute
-derived class into your code window. See Chapter 2 for an explication of using code snippets.
Applying Custom Attributes
Given that VehicleDescriptionAttribute is derived from System.Attribute, you are now able to
annotate your vehicles as you see fit. For testing purposes, add the following class definitions to
your new class library:
Do'stlaringiz bilan baham: |