Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Determines how a class or field is displayed in the debugger variable windows.
Inheritance Hierarchy
System. . :: . .Object
System. . :: . .Attribute
System.Diagnostics..::..DebuggerDisplayAttribute
Namespace: System.Diagnostics
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
<AttributeUsageAttribute(AttributeTargets.Assembly Or AttributeTargets.Class Or AttributeTargets.Struct Or AttributeTargets.Enum Or AttributeTargets.Property Or AttributeTargets.Field Or AttributeTargets.Delegate, AllowMultiple := True)> _
Public NotInheritable Class DebuggerDisplayAttribute _
Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Delegate, AllowMultiple = true)]
public sealed class DebuggerDisplayAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Assembly|AttributeTargets::Class|AttributeTargets::Struct|AttributeTargets::Enum|AttributeTargets::Property|AttributeTargets::Field|AttributeTargets::Delegate, AllowMultiple = true)]
public ref class DebuggerDisplayAttribute sealed : public Attribute
[<Sealed>]
[<AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Delegate, AllowMultiple = true)>]
type DebuggerDisplayAttribute =
class
inherit Attribute
end
public final class DebuggerDisplayAttribute extends Attribute
The DebuggerDisplayAttribute type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() |
DebuggerDisplayAttribute | Initializes a new instance of the DebuggerDisplayAttribute class. |
Top
Properties
Name | Description | |
---|---|---|
![]() |
Name | Gets or sets the name to display in the debugger variable windows. |
![]() |
Target | Gets or sets the type of the attribute's target. |
![]() |
TargetTypeName | Gets or sets the type name of the attribute's target. |
![]() |
Type | Gets or sets the string to display in the type column of the debugger variable windows. |
![]() |
Value | Gets the string to display in the value column of the debugger variable windows. |
Top
Methods
Name | Description | |
---|---|---|
![]() |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() |
GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
The DebuggerDisplayAttribute constructor has a single argument: a string to be displayed in the value column for instances of the type. This string can contain braces ({ and }). The text within a pair of braces is evaluated as the name of a field, property, or method. For example, the following C# code causes "Count = 4" to be displayed when the plus sign (+) is selected to expand the debugger display for an instance of MyHashtable.
[DebuggerDisplay("Count = {count}")]
class MyHashtable
{
public int count = 4;
}
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.