引用XML代码注释中的泛型类型 [英] reference to generic type in XML code comment
问题描述
///< see cref =name.space.typename& lt; T& rt;(paramtype)>
但是我觉得还有另一种语法,比较笨拙?有些东西,要摆脱那些html实体的''?我现在找不到。有人可以帮忙吗
这是一篇关于文档的好文章: C#XML文档注释常见问题
编译器团队决定通过允许替代语法
在doc注释中引用通用类型和方法
来提高
。具体来说,
而不是使用开启和关闭
的尖括号,使用
打开和关闭花括号是合法的。然后,上面的
示例将变为:
class Program
{
///< summary>
/// DoSomething需要一个< see cref =List {T}/>
///< / summary>
void DoSomething(List< int> al){}
}
在你的情况下:
///< see cref =name.space.typename {T}(paramtype) />
As I know, in a XML comment for a C# type/method, it is possible to reference a generic type in a tag like so:
///<see cref="name.space.typename<T&rt;(paramtype)">
But I think, there was another syntax, which is less clumsy? Something, to get rid of those html entities '<'? I cannot find it right now. Can somebody help?
Here's a good article on documentation: C# XML documentation comments FAQ
The compiler team decided to improve this by allowing an alternate syntax to refer to generic types and methods in doc comments. Specifically, instead of using the open and close angle-brackets it’s legal to use the open and close curly braces. The example above would then become:
class Program
{
/// <summary>
/// DoSomething takes a <see cref="List{T}"/>
/// </summary>
void DoSomething(List<int> al) { }
}
So, in your case:
///<see cref="name.space.typename{T}( paramtype )" />
这篇关于引用XML代码注释中的泛型类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!