Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Defining and Using Custom Attribute Classes in C# : Page 4

.NET has made flexible, loosely-coupled "declarative" programming available through Attributes. .NET also allows you to create your own custom Attribute classes.


advertisement
Retrieving the Values of the Custom Attributes
At this point, even though you've applied your custom attribute to some classes and methods, you haven't really seen it in action. It seems as if nothing really occurs whether you attach the attributes or not. But something does occur and you don't have to take my word for it. You can use the MSIL Disassembler to open an EXE or DLL that contains types you've decorated with your custom attributes. The MSIL Disassembler lets you see that .NET included your attributes and their values right there in the IL code. Figure 1 shows an example of ILDASM form with the EXE from the sample code in this article opened.


David Tansey is Director of Consulting for F1 Technologies, developers of the award-winning business application framework, Visual FoxExpress. Based in San Francisco, he oversees F1 Technologies' consulting projects and participates in product design and development. David was the primary developer of FullContact, F1 Technologies' framework for developing CRM applications. David has spoken at the Computer Associates CA-WORLD software expo, at software development user groups across the country, and has published articles in CoDe Magazine and CAS-WORLD. dtansey@f1tech.com.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Thanks for your registration, follow us on our social networks to keep up-to-date