
Using a Custom Attribute | 133
Attributes
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
This routine is not that different in its overall structure from the EnumerateTypes
routine, but there is some interesting code used in the formatting of the member
name. If the
memberScan object represents a constructor, “.ctor” is used for the
member name. The routine converts this to the more user-friendly “New.”
The program provides a good overview of attribute analysis, although it could be
enhanced even more. The EnumerateTypes routine could be made a little more
generic, and recursion added, allowing it to display attribute information found in
nested classes. Another reasonable enhancement would display developer notes
associated with parameters belonging to individual methods.