DebuggerBrowsableAttribute(DebuggerBrowsableState) 생성자

정의

DebuggerBrowsableAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 DebuggerBrowsableAttribute(System::Diagnostics::DebuggerBrowsableState state);
public DebuggerBrowsableAttribute (System.Diagnostics.DebuggerBrowsableState state);
new System.Diagnostics.DebuggerBrowsableAttribute : System.Diagnostics.DebuggerBrowsableState -> System.Diagnostics.DebuggerBrowsableAttribute
Public Sub New (state As DebuggerBrowsableState)

매개 변수

state
DebuggerBrowsableState

멤버 표시 방법을 지정하는 DebuggerBrowsableState 값 중 하나입니다.

예외

stateDebuggerBrowsableState 값 중 하나가 아닌 경우

예제

다음 코드 예제에서는 특성을 사용하여 디버거에 속성의 DebuggerBrowsableAttribute 루트(속성 이름) Keys 를 표시하지 않고 가져오는 배열의 요소를 표시하도록 지시하는 방법을 Keys 보여 줍니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DebuggerDisplayAttribute 클래스입니다.

[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

설명

이 특성은 속성 및 필드에만 적용할 수 있습니다.

적용 대상