我正在尝试编写文档注释,但是我遇到了问题。
/// <summary>
/// Inserts an element into the System.Collections.Generic.List<T> at the specified
/// index.
/// </summary>
当我到达<T>
Visual Studio 认为我正在尝试添加另一个标签。添加这样的评论的正确方法是什么(如果我能让它们在生成的帮助文本中点击,那将是额外的奖励)
C# 文档注释是 XML,因此更改您的<
and >
to <
and >
.
不过,你最好做的是使用<see>
标签以插入超链接。在一个<see>
标记、更改<T>
to {T}
:
/// <summary>
/// Inserts an element into the <see cref="List{T}"/> at the specified
/// index.
/// </summary>
(请注意,cref
与普通文本不同,属性由编译器进行语法检查。)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)