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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > 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) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「DebuggerTypeProxyAttribute クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS