DebuggerTypeProxyAttribute 생성자

정의

프록시 유형을 사용하여 클래스의 DebuggerTypeProxyAttribute 새 인스턴스를 초기화합니다.

오버로드

Name Description
DebuggerTypeProxyAttribute(String)

프록시의 형식 이름을 사용하여 클래스의 DebuggerTypeProxyAttribute 새 인스턴스를 초기화합니다.

DebuggerTypeProxyAttribute(Type)

프록시 유형을 사용하여 클래스의 DebuggerTypeProxyAttribute 새 인스턴스를 초기화합니다.

DebuggerTypeProxyAttribute(String)

Source:
DebuggerTypeProxyAttribute.cs
Source:
DebuggerTypeProxyAttribute.cs
Source:
DebuggerTypeProxyAttribute.cs
Source:
DebuggerTypeProxyAttribute.cs
Source:
DebuggerTypeProxyAttribute.cs

프록시의 형식 이름을 사용하여 클래스의 DebuggerTypeProxyAttribute 새 인스턴스를 초기화합니다.

public:
 DebuggerTypeProxyAttribute(System::String ^ typeName);
public DebuggerTypeProxyAttribute(string typeName);
new System.Diagnostics.DebuggerTypeProxyAttribute : string -> System.Diagnostics.DebuggerTypeProxyAttribute
Public Sub New (typeName As String)

매개 변수

typeName
String

프록시 형식의 형식 이름입니다.

설명

디버거는 대상 형식의 변수를 표시해야 할 때마다 형식 프록시 클래스의 새 인스턴스를 만듭니다. 성능에 영향을 미칠 수 있습니다. 따라서 반드시 필요한 것보다 생성자에서 더 이상 작업을 수행해서는 안 됩니다.

적용 대상

DebuggerTypeProxyAttribute(Type)

Source:
DebuggerTypeProxyAttribute.cs
Source:
DebuggerTypeProxyAttribute.cs
Source:
DebuggerTypeProxyAttribute.cs
Source:
DebuggerTypeProxyAttribute.cs
Source:
DebuggerTypeProxyAttribute.cs

프록시 유형을 사용하여 클래스의 DebuggerTypeProxyAttribute 새 인스턴스를 초기화합니다.

public:
 DebuggerTypeProxyAttribute(Type ^ type);
public DebuggerTypeProxyAttribute(Type type);
new System.Diagnostics.DebuggerTypeProxyAttribute : Type -> System.Diagnostics.DebuggerTypeProxyAttribute
Public Sub New (type As Type)

매개 변수

type
Type

프록시 형식입니다.

예외

typenull입니다.

예제

다음 코드 예제에서는 디버거 표시 프록시를 DebuggerTypeProxyAttribute(Type) 지정 하는 생성자를 사용 하는 방법을 보여 있습니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 DebuggerDisplayAttribute 일부입니다.

[DebuggerTypeProxy(typeof(HashtableDebugView))]
class MyHashtable : Hashtable
{
    private const string TestString = "This should not appear in the debug window.";

    internal class HashtableDebugView
    {
        private Hashtable hashtable;
        public const string TestString = "This should appear in the debug window.";
        public HashtableDebugView(Hashtable hashtable)
        {
            this.hashtable = hashtable;
        }

        [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;
            }
        }
    }
}
<DebuggerDisplay("Count = {Count}"), DebuggerTypeProxy(GetType(MyHashtable.HashtableDebugView))> _
Class MyHashtable
    Inherits Hashtable
    Private Const TestString As String = "This should not appear in the debug window."

    Friend Class HashtableDebugView
        Private hashtable As Hashtable
        Public Shared TestString As String = "This should appear in the debug window."

        Public Sub New(ByVal hashtable As Hashtable)
            Me.hashtable = hashtable
        End Sub

        <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

    End Class
End Class

설명

디버거는 대상 형식의 변수를 표시해야 할 때마다 형식 프록시 클래스의 새 인스턴스를 만듭니다. 성능에 영향을 미칠 수 있습니다. 따라서 반드시 필요한 것보다 생성자에서 더 이상 작업을 수행해서는 안 됩니다.

적용 대상