Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

DebuggerBrowsableState Enumeration

Provides display instructions for the debugger.

Namespace:  System.Diagnostics
Assemblies:   System.Diagnostics.Debug (in System.Diagnostics.Debug.dll)
  mscorlib (in mscorlib.dll)

public enum 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)]
public KeyValuePairs[] Keys
{
    get
    {
        KeyValuePairs[] keys = new KeyValuePairs[hashtable.Count];

        int i = 0;
        foreach(object key in hashtable.Keys)
        {
            keys[i] = new KeyValuePairs(hashtable, key, hashtable[key]);
            i++;
        }
        return keys;
    }
}

.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
Show:
© 2015 Microsoft