DebuggerTypeProxyAttributeとは? わかりやすく解説

DebuggerTypeProxyAttribute クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

型の表示プロキシ指定します

名前空間: System.Diagnostics
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
<AttributeUsageAttribute(AttributeTargets.Assembly Or AttributeTargets.Class
 Or AttributeTargets.Struct, AllowMultiple:=True)> _
Public NotInheritable Class
 DebuggerTypeProxyAttribute
    Inherits Attribute
Dim instance As DebuggerTypeProxyAttribute
[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
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct,
 AllowMultiple=true) */ 
public final class DebuggerTypeProxyAttribute
 extends Attribute
ComVisibleAttribute(true) 
AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct,
 AllowMultiple=true) 
public final class DebuggerTypeProxyAttribute
 extends 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.Object
   System.Attribute
    System.Diagnostics.DebuggerTypeProxyAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DebuggerTypeProxyAttribute コンストラクタ (String)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

プロキシ型名使用して、DebuggerTypeProxyAttribute クラス新しインスタンス初期化します。

名前空間: System.Diagnostics
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Dim typeName As String

Dim instance As New DebuggerTypeProxyAttribute(typeName)
public DebuggerTypeProxyAttribute (
    string typeName
)
public:
DebuggerTypeProxyAttribute (
    String^ typeName
)
public DebuggerTypeProxyAttribute (
    String typeName
)
public function DebuggerTypeProxyAttribute
 (
    typeName : String
)

パラメータ

typeName

プロキシ型型名

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DebuggerTypeProxyAttribute クラス
DebuggerTypeProxyAttribute メンバ
System.Diagnostics 名前空間

DebuggerTypeProxyAttribute コンストラクタ (Type)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

プロキシの型を使用して、DebuggerTypeProxyAttribute クラス新しインスタンス初期化します。

名前空間: System.Diagnostics
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Dim type As Type

Dim instance As New DebuggerTypeProxyAttribute(type)
public DebuggerTypeProxyAttribute (
    Type type
)
public:
DebuggerTypeProxyAttribute (
    Type^ type
)
public DebuggerTypeProxyAttribute (
    Type type
)
public function DebuggerTypeProxyAttribute
 (
    type : Type
)

パラメータ

type

プロキシ型を表す Type オブジェクト

例外例外
例外種類条件

ArgumentNullException

typenull 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

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;
         }
      }
   }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DebuggerTypeProxyAttribute クラス
DebuggerTypeProxyAttribute メンバ
System.Diagnostics 名前空間

DebuggerTypeProxyAttribute コンストラクタ

プロキシの型を使用して、DebuggerTypeProxyAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

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

関連項目

DebuggerTypeProxyAttribute クラス
DebuggerTypeProxyAttribute メンバ
System.Diagnostics 名前空間

DebuggerTypeProxyAttribute プロパティ


パブリック プロパティパブリック プロパティ

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

関連項目

DebuggerTypeProxyAttribute クラス
System.Diagnostics 名前空間

その他の技術情報

DebuggerTypeProxy 属性使用

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 クラス
System.Diagnostics 名前空間

その他の技術情報

DebuggerTypeProxy 属性使用

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 から継承されます。)
参照参照

関連項目

DebuggerTypeProxyAttribute クラス
System.Diagnostics 名前空間

その他の技術情報

DebuggerTypeProxy 属性使用


このページでは「.NET Framework クラス ライブラリ リファレンス」からDebuggerTypeProxyAttributeを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDebuggerTypeProxyAttributeを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDebuggerTypeProxyAttribute を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DebuggerTypeProxyAttribute」の関連用語

DebuggerTypeProxyAttributeのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DebuggerTypeProxyAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS