Doxygen
XML Commands

Doxygen supports most of the XML commands that are typically used in C# code comments. The XML tags are defined in Appendix D of the ECMA-334 standard, which defines the C# language. Unfortunately, the specification is not very precise and a number of the examples given are of poor quality.

Here is the list of tags supported by doxygen:

  • <c> Identifies inline text that should be rendered as a piece of code. Similar to using <tt>text</tt>.
  • <code> Set one or more lines of source code or program output. Note that this command behaves like \code ... \endcode for C# code, but it behaves like the HTML equivalent <CODE>...</CODE> for other languages.
  • <description> Part of a <list> command, describes an item.
  • <example> Marks a block of text as an example, ignored by doxygen.
  • <exception cref="member"> Identifies the exception a method can throw.
  • <include> Can be used to import a piece of XML from an external file. Ignored by doxygen at the moment.
  • <inheritdoc> Can be used to insert the documentation of a member of a base class into the documentation of a member of a derived class that reimplements it.
  • <item> List item. Can only be used inside a <list> context.

  • <list type="type"> Starts a list, supported types are bullet or number and table. A list consists of a number of <item> tags. A list of type table, is a two column table which can have a header.
  • <listheader> Starts the header of a list of type "table".
  • <para> Identifies a paragraph of text.
  • <param name="paramName"> Marks a piece of text as the documentation for parameter "paramName". Similar to using \param.
  • <paramref name="paramName"> Refers to a parameter with name "paramName". Similar to using \a.
  • <permission> Identifies the security accessibility of a member. Ignored by doxygen.
  • <remarks> Identifies the detailed description.
  • <returns> Marks a piece of text as the return value of a function or method. Similar to using \return.
  • <see cref="member"> Refers to a member. Similar to \ref.
  • <seealso cref="member"> Starts a "See also" section referring to "member". Similar to using \sa member.
  • <summary> In case this tag is used outside a <DETAILS> tag this tag identifies the brief description. Similar to using \brief. In case this tag is used inside a <DETAILS> tag this tag identifies the heading of the <DETAILS> tag.
  • <term> Part of a <list> command.
  • <typeparam name="paramName"> Marks a piece of text as the documentation for type parameter "paramName". Similar to using \param.
  • <typeparamref name="paramName"> Refers to a parameter with name "paramName". Similar to using \a.
  • <value> Identifies a property. Ignored by doxygen.
  • <![CDATA[...]]> The text inside this tag (on the ...) is handled as normal doxygen comment except for the XML special characters <, > and & that are used as if they were escaped.

Here is an example of a typical piece of code using some of the above commands:

/// <summary>
/// A search engine.
/// </summary>
class Engine
{
/// <summary>
/// The Search method takes a series of parameters to specify the search criterion
/// and returns a dataset containing the result set.
/// </summary>
/// <param name="connectionString">the connection string to connect to the
/// database holding the content to search</param>
/// <param name="maxRows">The maximum number of rows to
/// return in the result set</param>
/// <param name="searchString">The text that we are searching for</param>
/// <returns>A DataSet instance containing the matching rows. It contains a maximum
/// number of rows specified by the maxRows parameter</returns>
public DataSet Search(string connectionString, int maxRows, int searchString)
{
DataSet ds = new DataSet();
return ds;
}
}

Go to the next section or return to the index.