
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.