Building Custom Attributes
The first step in building a custom attribute is to create a new class deriving from System.Attribute.
Keeping in step with the automobile theme used throughout this book, assume you have created a
brand new C# class library named AttributedCarLibrary. This assembly will define a handful of
vehicles (some of which you have already seen in this text), each of which is described using a cus-
tom attribute named VehicleDescriptionAttribute:
C H A P T E R 1 6
■
T Y P E R E F L E C T I O N, L AT E B I N D I N G, A N D AT T R I B U T E - B A S E D P R O G R A M M I N G
546
8849CH16.qxd 10/9/07 4:27 PM Page 546
Do'stlaringiz bilan baham: |