[C#]使用DebuggerDisplayAttribute自訂除錯監看訊息
[System.Diagnostics.DebuggerDisplay("Name = {Name}, Year = {Year}")]
class Person
{
[System.Diagnostics.DebuggerDisplay("Name = {Name}")]
string Name { get; set; }
int Year { get; set; }
public Person(string name, int year)
{
this.Name = name;
this.Year = year;
}
}</pre></div>