m-y*_*m-y 8 exception xml-comments
这是一个例子:
public void DoSomething(String param1, String param2)
{
if (param1 == null) throw new ArgumentNullException("param1");
if (param2 == null) throw new ArgumentNullException("param2");
}
Run Code Online (Sandbox Code Playgroud)
ArgumentNullException的2个不同原因.MSDNs String.Format示例显示了2个不同的原因FormatException.那么,它是这样做的:
/// <exception cref="ArgumentNullException">
/// <paramref name="param1"/> is null.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="param2"/> is null.
/// </exception>
Run Code Online (Sandbox Code Playgroud)
还是其他一些方式?
/// <exception cref="ArgumentNullException">
/// Some other way to show the 2 reasons with an "-or-" between them.
/// </exception>
Run Code Online (Sandbox Code Playgroud)
Mig*_*elo 14
如果您认为文档的每一行都是一个<exception cref=...> </exception>,那么逻辑上正确的方法就是使用您的第二个替代方案:
/// <exception cref="ArgumentNullException">
/// <p><paramref name="param1"/> is null. </p>
/// <p>- or - </p>
/// <p><paramref name="param2"/> is null. </p>
/// </exception>
Run Code Online (Sandbox Code Playgroud)
您可以使用'p'元素来表示线条.
| 归档时间: |
|
| 查看次数: |
1348 次 |
| 最近记录: |