use*_*238 52 c# xml generics documentation reference
据我所知,在C#类型/方法的XML注释中,可以在标记中引用泛型类型,如下所示:
///<see cref="name.space.typename<T&rt;(paramtype)">
Run Code Online (Sandbox Code Playgroud)
但我认为,还有另一种语法,不那么笨拙?什么,摆脱那些HTML实体的''?我现在找不到它.有人可以帮忙吗?
Met*_*urf 68
这是一篇关于文档的好文章:C#XML文档注释FAQ
编译器团队决定通过允许替代语法引用doc注释中的泛型类型和方法来改进这一点.具体来说,使用开放和闭合的花括号,而不是使用开放和关闭角括号,是合法的.上面的例子将成为:
class Program
{
/// <summary>
/// DoSomething takes a <see cref="List{T}"/>
/// </summary>
void DoSomething(List<int> al) { }
}
Run Code Online (Sandbox Code Playgroud)
所以,在你的情况下:
///<see cref="name.space.typename{T}( paramtype )" />
Run Code Online (Sandbox Code Playgroud)
编辑:上面的链接有点破碎; 显示原始html.暂时离开链接.以下是Microsoft的一些较新的参考资料:
| 归档时间: |
|
| 查看次数: |
15085 次 |
| 最近记录: |