views:

47

answers:

3

What is the correct syntax for an XML comment for a class property?

+3  A: 

Install this: http://submain.com/products/ghostdoc.aspx

Right-click on the property, select 'Document This'. Fill in the blanks.

MonkeyWrench
Ghostdoc is nice, but the auto-generated comments are not really helpful and can be omitted anyway.
BeowulfOF
Yes, but it automatically adds the correct structure. You can always edit the auto-generated text afterwards. And half the time, if you name your methods logically, it gets the comment correct.
MonkeyWrench
A: 

According to MSDN, link, it appears there isn't an official tag for Class Properties. But, I would use something like this:

/// <summary>Here is an example of a propertylist:
/// <list type="Properties">
/// <item>
/// <description>Property 1.</description>
/// </item>
/// <item>
/// <description>Property 2.</description>
/// </item>
/// </list>
/// </summary>
pattertj
+1  A: 

I'd suggest to use StyleCop. It does not only enforce (a bit to strong for my taste) you to comment, but also gives you a hint how the comments should be startet.

BeowulfOF