DebuggerBrowsableState Enumeração

Definição

Fornece instruções de exibição para o depurador.

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
Herança
DebuggerBrowsableState
Atributos

Campos

Collapsed 2

Exibir o elemento como recolhido.

Never 0

Nunca exibir o elemento.

RootHidden 3

Não exibir o elemento raiz; exibir elementos filho se o elemento for uma coleção ou matriz de itens.

Exemplos

O exemplo de código a seguir mostra o uso da DebuggerBrowsableState enumeração para instruir o depurador a não exibir a raiz (nome da Keys propriedade), mas exibir os elementos da matriz que Keys obtém. Este exemplo de código faz parte de um exemplo maior fornecido para a DebuggerDisplayAttribute classe.

[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

Comentários

DebuggerBrowsableState é usado para simplificar a exibição na janela de depuração. O uso do DebuggerDisplayAttribute atributo usando essa enumeração pode resultar em uma exibição muito mais simples e agradável na janela de depuração. Consulte a DebuggerBrowsableAttribute classe para obter informações sobre o uso dessa enumeração.

Aplica-se a