Expand Minimize

DebuggerBrowsableState Enumeration

Provides display instructions for the debugger.

Namespace:  System.Diagnostics
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
<ComVisibleAttribute(True)> _
Public Enumeration DebuggerBrowsableState

Member nameDescription
Supported by Portable Class LibraryCollapsedShow the element as collapsed.
Supported by Portable Class LibraryNeverNever show the element.
Supported by Portable Class LibraryRootHiddenDo not display the root element; display the child elements if the element is a collection or array of items.

DebuggerBrowsableState is used to simplify the view in the debug window. Use of the DebuggerDisplayAttribute attribute using this enumeration can result in a much simpler and more pleasing view in the debug window. See the DebuggerBrowsableAttribute class for information on the use of this enumeration.

The following code example shows the use of the DebuggerBrowsableState enumeration to instruct the debugger to not display the root (property name) of the Keys property, but to display the elements of the array that Keys gets. This code example is part of a larger example provided for the DebuggerDisplayAttribute class.

<DebuggerBrowsable(DebuggerBrowsableState.RootHidden)> _
ReadOnly Property Keys as KeyValuePairs()
    Get 
        Dim nkeys(hashtable.Count) as KeyValuePairs

        Dim i as Integer = 0
        For Each key As Object In hashtable.Keys
            nkeys(i) = New KeyValuePairs(hashtable, key, hashtable(key))
            i = i + 1
        Next 
        Return nkeys
    End Get 
End Property

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft