Skip to content

Latest commit

 

History

History
76 lines (65 loc) · 1.67 KB

File metadata and controls

76 lines (65 loc) · 1.67 KB

DOC102

TypeName DOC102UseChildBlocksConsistentlyAcrossElementsOfTheSameKind
CheckId DOC102
Category Style Rules

Cause

The documentation for the element contains inline text, but the documentation for a sibling element of the same kind uses block-level elements.

Rule description

A violation of this rule occurs when a documentation contains sibling elements of the same kind, where some siblings use block-level content, but others do not. In the following example, one param element uses inline content, while another param element uses block content.

/// <summary>
/// Summary text.
/// </summary>
/// <param name="x">Inline content.</param>
/// <param name="y">
/// <para>Block content.</para>
/// </param>
public void SomeOperation(int x, int y)
{
}

How to fix violations

To fix a violation of this rule, place the content in a block-level element, such as a <para> element.

/// <summary>
/// Summary text.
/// </summary>
/// <param name="x">
/// <para>Block content.</para>
/// </param>
/// <param name="y">
/// <para>Block content.</para>
/// </param>
public void SomeOperation(int x, int y)
{
}

How to suppress violations

#pragma warning disable DOC102 // Use child blocks consistently across elements of the same kind
/// <summary>
/// Summary text.
/// </summary>
/// <param name="x">Inline content.</param>
/// <param name="y">
/// <para>Block content.</para>
/// </param>
public void SomeOperation(int x, int y)
#pragma warning restore DOC102 // Use child blocks consistently across elements of the same kind
{
}