DebuggerTypeProxyAttribute クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<ComVisibleAttribute(True)> _ <AttributeUsageAttribute(AttributeTargets.Assembly Or AttributeTargets.Class Or AttributeTargets.Struct, AllowMultiple:=True)> _ Public NotInheritable Class DebuggerTypeProxyAttribute Inherits Attribute
[ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple=true)] public sealed class DebuggerTypeProxyAttribute : Attribute
[ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets::Assembly|AttributeTargets::Class|AttributeTargets::Struct, AllowMultiple=true)] public ref class DebuggerTypeProxyAttribute sealed : public Attribute

メモ 型自体を変更せずに、型のデバッグ ビューを根本的かつ大幅に変更する必要がある場合は、この属性を使用します。
DebuggerTypeProxyAttribute 属性を使用して型の表示プロキシを指定することにより、開発者は型のビューをカスタマイズできます。この属性はアセンブリ レベルでも使用できます。その場合は、Target プロパティでプロキシを使用する対象の型を指定します。一般に、この属性は、属性の適用対象である型で発生する、プライベートな入れ子にされた型を指定します。型ビューアをサポートする式エバリュエータは、型が表示されるときにこの属性をチェックします。属性が存在する場合、式エバリュエータは属性の適用対象の型の代わりに表示プロキシ型を使用します。
DebuggerBrowsableAttribute が存在する場合、デバッガ変数ウィンドウにはプロキシ型のパブリック メンバのみが表示されます。プライベート メンバは表示されません。データ ウィンドウの動作は、ビューの属性が拡張されても変わりません。
パフォーマンスの低下を避けるために、通常、式エバリュエータは型の表示プロキシの属性を調べません。データ ウィンドウでユーザーが型の横の正符号 (+) をクリックした場合、または DebuggerBrowsableAttribute 属性の適用によって型が展開された場合のみ調べます。したがって、表示型に属性を適用しないことをお勧めします。属性は、表示型の本体に適用可能なので、表示型の本体に適用してください。

DebuggerTypeProxyAttribute を使用して、デバッガ表示プロキシとして使われる、プライベートな入れ子にされた型を指定するコード例を次に示します。このコード例は、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; } } } }

System.Attribute
System.Diagnostics.DebuggerTypeProxyAttribute


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DebuggerTypeProxyAttribute コンストラクタ (String)
アセンブリ: mscorlib (mscorlib.dll 内)


デバッガは、対象の型の変数を表示する必要が生じるたびに型プロキシ クラスの新しいインスタンスを作成します。その結果、パフォーマンスが低下する可能性があります。したがって、コンストラクタでは必要最小限の作業のみを実行するようにしてください。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DebuggerTypeProxyAttribute コンストラクタ (Type)
アセンブリ: mscorlib (mscorlib.dll 内)



デバッガは、対象の型の変数を表示する必要が生じるたびに型プロキシ クラスの新しいインスタンスを作成します。その結果、パフォーマンスが低下する可能性があります。したがって、コンストラクタでは必要最小限の作業のみを実行するようにしてください。

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; } } } }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DebuggerTypeProxyAttribute コンストラクタ

名前 | 説明 |
---|---|
DebuggerTypeProxyAttribute (String) | プロキシの型名を使用して、DebuggerTypeProxyAttribute クラスの新しいインスタンスを初期化します。 |
DebuggerTypeProxyAttribute (Type) | プロキシの型を使用して、DebuggerTypeProxyAttribute クラスの新しいインスタンスを初期化します。 |

DebuggerTypeProxyAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | ProxyTypeName | プロキシ型の型名を取得します。 |
![]() | Target | 属性の対象の型を取得または設定します。 |
![]() | TargetTypeName | 対象の型の名前を取得または設定します。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |

DebuggerTypeProxyAttribute メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 ( Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

DebuggerTypeProxyAttribute メンバ
DebuggerTypeProxyAttribute データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | DebuggerTypeProxyAttribute | オーバーロードされます。 プロキシの型を使用して、DebuggerTypeProxyAttribute クラスの新しいインスタンスを初期化します。 |

名前 | 説明 | |
---|---|---|
![]() | ProxyTypeName | プロキシ型の型名を取得します。 |
![]() | Target | 属性の対象の型を取得または設定します。 |
![]() | TargetTypeName | 対象の型の名前を取得または設定します。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 (Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からDebuggerTypeProxyAttributeを検索する場合は、下記のリンクをクリックしてください。

- DebuggerTypeProxyAttributeのページへのリンク