DebuggerDisplayAttribute.Name 속성

정의

디버거 변수 창에 표시할 이름을 가져오거나 설정합니다.

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public string Name { get; set; }
public string? Name { get; set; }
member this.Name : string with get, set
Public Property Name As String

속성 값

디버거 변수 창에 표시할 이름입니다.

예제

다음 코드 예제에서는 각 키의 이름과 값이 디버거 변수 창에 표시됩니다. 특성이 적용되지 않으면 인덱스 및 값 형식이 표시됩니다(예: "[0] {KeyValuePairs}"). 특성이 적용되면 키의 이름과 해당 값이 표시됩니다(예: 첫 번째 키가 "one"이고 값이 1인 경우 표시는 "one 1"). 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DebuggerDisplayAttribute 클래스입니다.

[DebuggerDisplay("{value}", Name = "{key}")]
ref class KeyValuePairs
{
private:
    IDictionary^ dictionary;
    Object^ key;
    Object^ value;

public:
    KeyValuePairs(IDictionary^ dictionary, Object^ key, Object^ value)
    {
        this->value = value;
        this->key = key;
        this->dictionary = dictionary;
    }
};
[DebuggerDisplay("{value}", Name = "{key}")]
internal class KeyValuePairs
{
    private IDictionary dictionary;
    private object key;
    private object value;

    public KeyValuePairs(IDictionary dictionary, object key, object value)
    {
        this.value = value;
        this.key = key;
        this.dictionary = dictionary;
    }
}
<DebuggerDisplay("{value}", Name := "{key}")>  _
Friend Class KeyValuePairs
    Private dictionary As IDictionary
    Private key As Object
    Private value As Object
    
    
    Public Sub New(ByVal dictionary As IDictionary, ByVal key As Object, ByVal value As Object) 
        Me.value = value
        Me.key = key
        Me.dictionary = dictionary

    End Sub
End Class

설명

값에는 중괄호({ 및 })가 포함될 수 있습니다. 중괄호 쌍 내의 텍스트는 필드, 속성 또는 메서드의 이름으로 평가됩니다.

적용 대상