DebuggerBrowsableAttribute

Another debugger attribute is the DebuggerBrowsableAttribute type, which determines how a member is displayed in a debug window. This attribute is valid for properties, indexers, and fields.

DebuggerBrowsableAttribute has a one-argument constructor only. The parameter is the DebuggableBrowsableState enumeration. Table 15-21 lists the elements of the enumeration.

Table 15-21. DebuggableBrowserState values

Value

Description

Never

Hides the member in the Debug window.

Collapsed

Displays the member as collapsed.

RootHidden

Hides the root member but displays the child elements if the element is an array or a collection. For example, when applied to a property that is an integer array, the integer elements are displayed instead of the ...

Get Programming Microsoft® Visual C#® 2008: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.