8
下面是一个例子:XML评论 - 如何评论异常的多种原因?
public void DoSomething(String param1, String param2)
{
if (param1 == null) throw new ArgumentNullException("param1");
if (param2 == null) throw new ArgumentNullException("param2");
}
2的ArgumentNullException不同的原因。 MSDNs String.Format Example显示FormatException
的两个不同原因。那么,它是这样做的:
/// <exception cref="ArgumentNullException">
/// <paramref name="param1"/> is null.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="param2"/> is null.
/// </exception>
或其他方式?
/// <exception cref="ArgumentNullException">
/// Some other way to show the 2 reasons with an "-or-" between them.
/// </exception>
我真的结束了使用,但它似乎应该有一个更好的方式来做到这一点。好吧。此外,应使用 而不是
。他们都是平等的,但考虑到智能识别我认为加倍“”与将文档中的表行加倍相同。当然,'para'标签要好得多。 –