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:

XML CommandDescription
\startalign\endalign <c>Identifies inline text that should be rendered as a piece of code. Similar to using <tt>text</tt>.
\startalign\endalign <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.
\startalign\endalign <description>Part of a <list> command, describes an item.
\startalign\endalign <example>Marks a block of text as an example, ignored by doxygen.
\startalign\endalign <exception cref="member">Identifies the exception a method can throw.
\startalign\endalign <include>Can be used to import a piece of XML from an external file. Ignored by doxygen at the moment.
\startalign\endalign <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.
\startalign\endalign <item>List item. Can only be used inside a <list> context.
\startalign\endalign <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.
\startalign\endalign <listheader>Starts the header of a list of type "table".
\startalign\endalign <para>Identifies a paragraph of text.
\startalign\endalign <param name="paramName">Marks a piece of text as the documentation for parameter "paramName". Similar to using \param.
\startalign\endalign <paramref name="paramName">Refers to a parameter with name "paramName". Similar to using \a.
\startalign\endalign <permission>Identifies the security accessibility of a member. Ignored by doxygen.
\startalign\endalign <remarks>Identifies the detailed description.
\startalign\endalign <returns>Marks a piece of text as the return value of a function or method. Similar to using \return.
\startalign\endalign <see cref="member">Refers to a member. Similar to \ref.
\startalign\endalign <seealso cref="member">Starts a "See also" section referring to "member". Similar to using \sa member.
\startalign\endalign <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.
\startalign\endalign <term>Part of a <list> command.
\startalign\endalign <typeparam name="paramName">Marks a piece of text as the documentation for type parameter "paramName". Similar to using \param.
\startalign\endalign<typeparamref name="paramName">Refers to a parameter with name "paramName". Similar to using \a.
\startalign\endalign <value>Identifies a property. Ignored by doxygen.
\startalign\endalign <![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.