如何在 xmldoc 注释中换行
How to put a line break in xmldoc comments
我有以下摘要片段。
/// <summary>
/// Holds the future state for 4 pixels
/// Every pixel can be in 4 states, on, off, unknown, or don't care
/// Off=00, on=01, unknown = 10, don't care = 11.
/// The grid is like this:
/// <code>
/// TL|TR <br/>
/// ---+--- <br/>
/// BL|BR <br/>
/// </code>
/// </summary>
这在弹出提示中显示为:
Holds the future state for 4 pixels
Every pixel can be in 4 states,
on, off, unknown, or don't care
Off=00, on=01, unknown = 10,
don't care = 11.
The grid is like this:
TL|TR ---+--- BL|BR
中间的 ascii 艺术以等宽字体正确显示,但没有换行符。
如何正确显示换行符
您可以使用分段符 :
/// <summary>
/// The grid is like this:
/// <code>
/// TL|TR <para/>
/// ---+--- <para/>
/// BL|BR <para/>
/// </code>
/// </summary>
结果:
我有以下摘要片段。
/// <summary>
/// Holds the future state for 4 pixels
/// Every pixel can be in 4 states, on, off, unknown, or don't care
/// Off=00, on=01, unknown = 10, don't care = 11.
/// The grid is like this:
/// <code>
/// TL|TR <br/>
/// ---+--- <br/>
/// BL|BR <br/>
/// </code>
/// </summary>
这在弹出提示中显示为:
Holds the future state for 4 pixels Every pixel can be in 4 states,
on, off, unknown, or don't care Off=00, on=01, unknown = 10,
don't care = 11. The grid is like this:TL|TR ---+--- BL|BR
中间的 ascii 艺术以等宽字体正确显示,但没有换行符。
如何正确显示换行符
您可以使用分段符
/// <summary>
/// The grid is like this:
/// <code>
/// TL|TR <para/>
/// ---+--- <para/>
/// BL|BR <para/>
/// </code>
/// </summary>
结果: