Mark Hurd
7/26/2009 8:31:00 AM
"Nathan Sokalski" <njsokalski@hotmail.com> wrote in message
news:u9ptgbXDKHA.3848@TK2MSFTNGP02.phx.gbl...
>I have a class that I am writing in which I want to set the
>BrowsableAttribute of a Property inherited from it's base class at
>runtime. How and where would I do this? Thanks.
If you're building the type at runtime, you need to call
PropertyBuilder.SetCustomAttribute with a CustomAttributeBuilder you've
created with the Attribute you want.
Otherwise you can't change a compiled type at runtime.
You may however be able to use ComponentModel.TypeDescriptionProvider to
fake what you want, depending upon where you need the functionality.
Don't have time to explain this further now...
--
Regards,
Mark Hurd, B.Sc.(Ma.) (Hons.)