Skip to content

Latest commit

 

History

History
165 lines (131 loc) · 2.69 KB

Dev CSharp documentation comments.md

File metadata and controls

165 lines (131 loc) · 2.69 KB

Dev CSharp documentation comments

Links

General tags

<summary>description</summary>

<remarks>
description
</remarks>

Document members

<returns>description</returns>

<param name="name">description</param>

<paramref name="name"/>

<exception cref="member">description</exception>

<value>property-description</value>

Format documentation output

<remarks>
    <para>
        This is an introductory paragraph.
    </para>
    <para>
        This paragraph contains more details.
    </para>
</remarks>

<list type="bullet|number|table">
    <listheader>
        <term>term</term>
        <description>description</description>
    </listheader>
    <item>
        <term>Assembly</term>
        <description>The library or executable built from a compilation.</description>
    </item>
</list>

The tag gives you a way to indicate that text within a description should be marked as code. Use to indicate multiple lines as code.

<c>text</c>

<code>
    var index = 5;
    index++;
</code>

<example>
This shows how to increment an integer.
<code>
    var index = 5;
    index++;
</code>
</example>

Reuse documentation text

<inheritdoc [cref=""] [path=""]/>

<include file='filename' path='tagpath[@name="id"]' />

example

namespace MyNamespace;
public class MyType
{
    /// <returns>This is the returns text of MyMethod. It comes from triple slash comments.</returns>
    /// <remarks>This is the remarks text of MyMethod. It comes from triple slash comments.</remarks>
    /// <include file="MyAssembly.xml" path="doc/members/member[@name='M:MyNamespace.MyType.MyMethod']/*" />
    public int MyMethod(int p) => p;
}

Generate links and references

<see cref="member"/>
<!-- or -->
<see cref="member">Link text</see>
<!-- or -->
<see href="link">Link Text</see>
<!-- or -->
<see langword="keyword"/>

<seealso cref="member"/>
<!-- or -->
<seealso href="link">Link Text</seealso>

Generic types and methods

<typeparam name="TResult">The type returned from this method</typeparam>

<typeparamref name="TKey"/>