Hi,
Thanks for the response and tips.
> Out of curiosity, why can't you apply attributes at compile time?
This is a class which the developer (this is a tool for developers) could
want to add its own property editor in order to use together with
PropertyGrid, and I don't want to define a fixed editor. That is to say, the
point here is the customization of the editor, instead of a fixed one.
I know that in order to use the PropertyGrid with custom editors, an wrapper
could be used for this class but that will be much more work.
Thanks
Luis A.
"Alexander Shirshov" <(E-Mail Removed)> escribió en el mensaje
news:%23%(E-Mail Removed)...
> Luis,
>
> My guess is you need to use ICustomTypeDescriptor together with your own
> class that inherit from PropertyDescriptor. PropertyDescriptor's protected
> constructor allows you to pass an array of attributes for this property.
> This thread might get you started:
> http://discuss.develop.com/archives/...S&P=R4310&I=-3
>
> Out of curiosity, why can't you apply attributes at compile time?
>
> HTH,
> Alexander
>
> "Luis Arvayo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Is there some way to attach an editor to a property of a class at runtime
>> ?
>>
>> Ex.;
>>
>>
>> public class MyClass
>> {
>>
>> [Editor(typeof(ImageEditor),typeof(UITypeEditor)]
>> public int BitmapIndex
>> {
>> get {...}
>> set {...}
>> }
>> }
>>
>> Instead of defining statically before compile time, I need to define the
>> editor at runtime in order to be used together with the PropertyGrid. Is
>> tha possible ?
>>
>> Thanks
>> Luis A.
>>
>>
>>
>>
>
>