Why does EditorBrowsableState.Never exist?

There is an EditorBrowsableAttribute in the System.ComponentModel namespace . The EditorBrowsableState type has the following members:

  • Additionally
  • Is always
  • Never

What could be causing this annoying attribute? Especially the state Never. This hides the functionality, and then when you find it, you feel dirty using it. So, if you work at Microsoft and have implemented this class, tell me PLZ ... :)

The only case I can imagine makes sense when you want to mark something obsolete and hide it from intellisense in order to better navigate. But in all cases, I came across the fact that this attribute was used without an obsolete attribute. The most recent example I found is the wpf method of Dispatcher.CheckAccess ().

+3
source share
2 answers

IMO is an attribute dedicated to creating libraries inside your VS solution (when dependencies are not external) Intellisense simply ignores it. There are several useful use cases.

EditorBrowsableState.Advanced: ( , VB.NET) IDE ( Intellisense), , . ( , BCL , ).

EditorBrowsableState.Never .

  • , ( ). Form.Closing (, Form.FormClosing).
  • . , , Keys.HanguelMode, ( ).
  • , . ( ). , InternalsVisibleToAttribute.
  • . , - , , , .
+6

EditorBrowsableState Visual Designers. EditorBrowsableState.Never , , , .

-1

Source: https://habr.com/ru/post/1608821/


All Articles