DebuggerDisplay attribute. (To remind me)

Having just read Kenny Kerr's blog on the Attributes Do Nothing post (http://weblogs.asp.net/kennykerr/archive/2006/06/02/Attributes-That-Do-Nothing.aspx) I have decided to partially repost the bit about the DebuggerDisplay attribute so I don't forget it.

Here we go:

[DebuggerDisplay("{Statement} Sarcasm: {Sarcasm}")]
class Quote
{
    public string Statement;
    public SarcasmLevel Sarcasm;
}

Will allow the watch window to show the properties you put in the attribute. Sweet!

No Comments