Click here to Skip to main content
Click here to Skip to main content

Attributes Inspector

, 28 Jan 2003
Rate this:
Please Sign up or sign in to vote.
Simple program to inspect custom attributes in assemblies

Sample Image - asseminspect.jpg

<!-- Add the rest of your HTML here -->

Disclaimer

This is my first article at Codeproject and I'm not an english speaker; please accept my apologies for the mistakes that I might make.

Introduction

I develop custom server controls in ASP.NET and C#, and one of my desperations is the integration of the controls in VS.NET designer surface. One of the problems is that I haven't found any simple application to see the custom attributes attached to types (ex: DesignerAttribute). I've searched documentation and I've written this simple application to do the job.

Application Description

The application is very simple, you can do the following tasks with it:

  • load an assembly: This shows at the bottom panel the custom attributes of the assembly, which can be recalled by double clicking at assembly name, and it shows public exported types contained in the assembly in the second panel.
  • To show custom attributes of a type, click on the type: It loads its properties , methods (not the inherited ones for brevity) and fields in the third panel and type custom attributes in the bottom panel.
  • To show custom attributes of a property , method or field, click on it.

The last version shows public and non public properties, and optionally by clicking the checkbox, show the values of the fields inside attributes.

Details

This application shows a few interesting things, obviously all of these interesting things are explained in other Codeproject articles and various documents, but it is another example:

  • Load assemblies at runtime and discovering its types, methods and properties using reflection
  • Obtaining custom attributes an its values at runtime.
  • Using the richtextbox with simplicity witch has being a discover to me.

To Do

There are few improvements which I can figure out:

  • Make the attribute description to show the exact type where it is declared, now it flattens the type hierarchy causing the same attribute to be shown more that one time and possibly with different values.
  • Use a tree control to show the types hierarchy

History

  • 02/29/2003 - Initial release
  • 02/30/2003 - Added the possibility to show non public properties of attributes, and optionally (by clicking the checkbox) the possibility to show field values (public and non public) of attributes which are of different colour.
  • 02/30/2003 (II)- Added the possibility to show attributes for fields in types

Conclusion

I've reached my objective to find what Designers are attached to control types of System.Web and I'll follow my investigations, and I've another tool in my toolbox.

By the way, the documentation and public articles on modifying and personalizing the design time of controls are very poor or I haven't found a deep enough article, please if you have found one, tell me.

Thanks for this great site.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Hzi
Web Developer
Spain Spain
My first computer comes at 12 years old (a nice Commodore 64), 19 years ago, and from then the computers became an important part of my live.
 
I've obtained the Coputer Science Engineering diploma at Facultat d'Informàtica de Barcelona.
 
The path has been:
BASIC
Assembler
Pascal
C
C++
C#
What's next?

Comments and Discussions

 
Generaluseful Pinmember.S.Rod.29-Jan-03 3:45 
GeneralRe: useful PinmemberHzi29-Jan-03 22:15 
I've uploaded a new version that arranges your first suggestion, now you can see field values of attributes.
 
Thanks.
 
PS: I'll update my bio soon.Smile | :)
GeneralRe: useful Pinmember.S.Rod.29-Jan-03 22:39 
GeneralRe: useful PinmemberHzi30-Jan-03 0:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411023.1 | Last Updated 29 Jan 2003
Article Copyright 2003 by Hzi
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid