在cref中使用可空类型的代码注释 [英] Code comment using nullable type in cref
本文介绍了在cref中使用可空类型的代码注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
有人知道如何为XML注释引用可为空的类型吗?
Does anyone know how to reference a nullable type for xml comments?
简单示例:
///< param name ="p1"><参见cref ="bool?". />参数</param>
/// <param name="p1"><see cref="bool?" /> type of parameter</param>
公共无效(布尔?p1)
public void (bool? p1)
{}
你这样做吗?
///< param name ="p1"><参见cref ="Nullable {T}". />参数</param>
/// <param name="p1"><see cref="Nullable{T}" /> type of parameter</param>
///< typeparamref name ="T"><参见cref ="bool". />可为null的类型</typeparamref>
/// <typeparamref name="T"><see cref="bool" /> nullable type</typeparamref>
看起来非常笨拙,我无法真正使它正常工作
Seems awfully clumsy and I can't really get it to work
谢谢
B.
推荐答案
很老的帖子,但万一有人偶然发现这篇帖子以寻找答案(就像我一样);正确的语法是:<请参阅cref =''Nullable {Bool}''/>.
Very old post, but in case anyone else stumbles across this post looking for an answer (like I did); the correct syntax is: <see cref="Nullable{Bool}"/>.
这篇关于在cref中使用可空类型的代码注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文