Comments

  • Thread starter Thread starter Gav
  • Start date Start date
G

Gav

Hi all,

In visual studio if you hover the mouse over a method of a object it will
tell you what it belongs to what it is and underneath it gives a brief
description i.e.. if you hover over DataSet.Tables this pops up:

System.Data.DataTableCollection DataSet.Tables
Get the collection of tables contained in the System.Data.DataSet

Is there a way to add comments to our own methods so they popup in this way?

Thanks
Gavin
 
Gavin,

Yes, there is. You have to provide XML documentation for your methods.
The text in the <summary> tag is what is displayed.

If you want to compile your code (who doesn't?) and distributed the
comments with your code, then you will have to place the xml comments file
in the same directory as the assembly referenced. Also, the filename needs
to be the same as the assembly, just with an xml extension.

Hope this helps.
 
Gav said:
In visual studio if you hover the mouse over a method of a object it will
tell you what it belongs to what it is and underneath it gives a brief
description i.e.. if you hover over DataSet.Tables this pops up:

System.Data.DataTableCollection DataSet.Tables
Get the collection of tables contained in the System.Data.DataSet

Is there a way to add comments to our own methods so they popup in this way?

Yes - this is XML documentation. If you look in the MSDN index for "XML
documentation" you should find most of what you need.

You might want to look at NDoc too - http://ndoc.sf.net.
 
Back
Top