A documentation comment is embedded XML that documents a type or member.
A documentation comment comes immediately before a type or member declaration, and starts with three slashes:
/// <summary>Cancels a command.</summary>
public void Cancel() {
...
}
Multiline comments can be done either like this:
/// <summary>
/// Cancels a command
/// </summary>
public void Cancel() {
...
}
or We can use the multiline document command /** */:
/**
<summary> Cancels a command. </summary>
*/
public void Cancel() {
...
}
If you compile with the /doc
directive,
the compiler extracts and collates documentation
comments into a single XML file.
Here are the standard XML tags that Visual Studio and documentation generators recognize:
<list type=[ bullet | number | table ]> <listheader> <term>...</term> <description>...</description> </listheader> <item> <term>...</term> <description>...</description> </item> </list>Creates a bulleted, numbered, or table-style list.