DebuggerBrowsableState Výčet

Definice

Poskytuje pokyny pro zobrazení ladicího programu.

public enum class DebuggerBrowsableState
public enum DebuggerBrowsableState
[System.Runtime.InteropServices.ComVisible(true)]
public enum DebuggerBrowsableState
type DebuggerBrowsableState = 
[<System.Runtime.InteropServices.ComVisible(true)>]
type DebuggerBrowsableState = 
Public Enum DebuggerBrowsableState
Dědičnost
DebuggerBrowsableState
Atributy

Pole

Collapsed 2

Zobrazí prvek jako sbalený.

Never 0

Nikdy nezozorujte prvek.

RootHidden 3

Nezobrazovat kořenový prvek; zobrazí podřízené prvky, pokud je element kolekce nebo pole položek.

Příklady

Následující příklad kódu ukazuje použití výčtu DebuggerBrowsableState dát ladicímu programu pokyn, aby nezobrazovat kořen (název vlastnosti) Keys vlastnosti, ale zobrazit prvky pole, které Keys získá. Tento příklad kódu je součástí většího příkladu DebuggerDisplayAttribute pro třídu.

[DebuggerBrowsable(DebuggerBrowsableState::RootHidden)]
property array<KeyValuePairs^>^ Keys
{
    array<KeyValuePairs^>^ get()
    {
        array<KeyValuePairs^>^ keys = gcnew array<KeyValuePairs^>(hashtable->Count);

        IEnumerator^ ie = hashtable->Keys->GetEnumerator();
        int i = 0;
        Object^ key;
        while (ie->MoveNext())
        {
            key = ie->Current;
            keys[i] = gcnew KeyValuePairs(hashtable, key, hashtable[key]);
            i++;
        }
        return keys;
    }
}
[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;
    }
}
<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

Poznámky

DebuggerBrowsableState slouží ke zjednodušení zobrazení v okně ladění. Použití atributu DebuggerDisplayAttribute pomocí tohoto výčtu může vést k mnohem jednoduššímu a příjemnějšímu zobrazení v okně ladění. Informace o použití tohoto výčtu najdete ve DebuggerBrowsableAttribute třídě.

Platí pro