|
Cet article a fait l'objet d'une traduction automatique. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte. Informations supplémentaires.
|
Traduction
Source
|
DebuggerDisplayAttribute, classe
Espace de noms : System.Diagnostics
Assembly : mscorlib (dans mscorlib.dll)
[ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Delegate, AllowMultiple = true)] public sealed class DebuggerDisplayAttribute : Attribute
Le type DebuggerDisplayAttribute expose les membres suivants.
| Nom | Description | |
|---|---|---|
![]() ![]() ![]() | DebuggerDisplayAttribute |
| Nom | Description | |
|---|---|---|
![]() ![]() ![]() | Name | |
![]() ![]() ![]() | Target | |
![]() ![]() ![]() | TargetTypeName | |
![]() ![]() ![]() | Type | |
![]() | TypeId | |
![]() ![]() ![]() | Value |
| Nom | Description | |
|---|---|---|
![]() ![]() ![]() | Equals | Infrastructure. |
![]() ![]() ![]() | GetHashCode | |
![]() ![]() ![]() | GetType | |
![]() | IsDefaultAttribute | |
![]() | Match | |
![]() ![]() ![]() | ToString |
| Nom | Description | |
|---|---|---|
![]() ![]() | _Attribute.GetIDsOfNames | |
![]() ![]() | _Attribute.GetTypeInfo | |
![]() ![]() | _Attribute.GetTypeInfoCount | |
![]() ![]() | _Attribute.Invoke |
[DebuggerDisplay("Count = {count}")]
class MyHashtable
{
public int count = 4;
}
using System; using System.Collections; using System.Diagnostics; using System.Reflection; class DebugViewTest { // The following constant will appear in the debug window for DebugViewTest. const string TabString = " "; // The following DebuggerBrowsableAttribute prevents the property following it // from appearing in the debug window for the class. [DebuggerBrowsable(DebuggerBrowsableState.Never)] public static string y = "Test String"; static void Main() { MyHashtable myHashTable = new MyHashtable(); myHashTable.Add("one", 1); myHashTable.Add("two", 2); Console.WriteLine(myHashTable.ToString()); Console.WriteLine("In Main."); } } [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("Count = {Count}")] [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 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (rôle principal du serveur non pris en charge), Windows Server 2008 R2 (rôle principal du serveur pris en charge avec SP1 ou version ultérieure ; Itanium non pris en charge)
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.


