Adding attributes to properties or fields at design time.
- From: "Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 01 Mar 2007 17:26:02 +0100
I have a component that does some interesting stuff exposing the member properties of a child control within a usercontrol properties of the parent control using a TypeDescriptionProvider.
Effectively, instead of dropping a text box on a control and then writing a property to expose the textbox's Text property, you just declare an attribute saying "expose the Text property of textBox1 in a property called MyText"
At the moment I have to physically write an attribute for each of the properties I want to expose but I'd really like to do something in the style of an ExtenderProvider and be able to have the design time add the attributes to the class declaration and serialize the whole lot automatically.
If you have any idea of how I might accomplish that I'd be happy to hear from you.
Please feel free to send me code to my personal address which can be obtained by removing the spamkiller from my e-mail address.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
.
- Prev by Date: Re: InheritedPropertyDescriptor vs. ReflectedPropertyDescriptor
- Next by Date: Re: InheritedPropertyDescriptor vs. ReflectedPropertyDescriptor
- Previous by thread: RE: InheritedPropertyDescriptor vs. ReflectedPropertyDescriptor
- Next by thread: How do I set DesignerSerializationVisibility on inherited properties?
- Index(es):
Relevant Pages
|