Is there a way to make a \"Browsable\" attribute conditional, so the property that applies it will sometimes appear in the properties page and sometimes not?
thanks
I came across this in search of a way to declare certain members visible or hidden in IntelliSense and be able to change it once for all that needed to be hidden at compile time. I can't tell if that's what you were looking for or not, but I found an answer to my question... figured it couldn't hurt to share.
I set a conditional compilation symbol (found in the Build tab of project properties) IS_VIS (value being true if you want certain members to show, false if your want to hide them) and then:
#if IS_VIS
public const System.ComponentModel.EditorBrowsableState isVis =
ComponentModel.EditorBrowsableState.Always;
#else
public const System.ComponentModel.EditorBrowsableState isVis =
ComponentModel.EditorBrowsableState.Never;
#endif
you then reference the isVis variable in the attribute:
[EditorBrowsable(isVis)]
public string myMethod...
I did this in VB and this was hastily converted to c#. If something doesn't work right, let me know.