Setting value of BrowsableAttribute at runtime

后端 未结 3 506
情深已故
情深已故 2021-01-20 01:46

I wanted to set a value of BrowsableAttribute for some of MyClass instance\'s properties at runtime:

 public class MyClass
{
     [         


        
3条回答
  •  渐次进展
    2021-01-20 02:39

    You can implement a custom type descriptor - which intercepts the the attribute on the way to whatever is using it. Thus having an effect which looks like the attribute is changing.

    See - Part 1, Part2

提交回复
热议问题