4

I have Visual Studio 2013 and I have noticed that it will not show Control.IsDisposed in IntelliSense. I am not sure whether this is the only thing that isn't displayed. Everything else seems to be shown fine in IntelliSense.

enter image description here

I can use the IsDisposed property fine, it will build and execute fine. Is there any reason for this or any known fix?

KarmaEDV
  • 1,631
  • 16
  • 27
KDecker
  • 6,928
  • 8
  • 40
  • 81

1 Answers1

7

The Control.IsDisposed property has the EditorBrowseableAttribute set to Advanced, which makes it non-browsable in the VS editor:

The property or method is a feature that only advanced users should see. An editor can either show or hide such properties.

[
Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
SRDescription(SR.ControlDisposedDescr)
]
public bool IsDisposed {
    get {
        return GetState(STATE_DISPOSED);
    }
}

Edit:

@Glen points out (thanks!) that you can view advanced members by changing the VS settings in Tools -> Options -> Text Editor -> C#:

Advanced members

Yuval Itzchakov
  • 146,575
  • 32
  • 257
  • 321
  • Found this in the article that Yuval linked to above: "In Visual C#, you can control when advanced properties appear in IntelliSense and the Properties Window with the Hide Advanced Members setting under Tools | Options | Text Editor | C#. The corresponding EditorBrowsableState is Advanced." – Glen J Fergo Sep 24 '15 at 14:08
  • This seems odd to me. Does anyone know the reasoning behind hiding "advanced" members? – KDecker Sep 24 '15 at 14:17
  • @KDecker [This answer](http://stackoverflow.com/a/27253880/1870803) has some info on when that's actually useful. – Yuval Itzchakov Sep 24 '15 at 14:25
  • 1
    My guess for the reasoning: to show a shortened pick list that only includes the members that are used most of the time, and excludes the more "advanced" members, thus making it quicker to find a specific member (assuming it is on the list, that is). – Polyfun Sep 24 '15 at 14:25
  • @Polyfun That, and perhaps hiding "advanced" properties that new programmers would get confused of or mistakenly use. – Yuval Itzchakov Sep 24 '15 at 14:26