Pil*_*anz 48
"功能"称为XML注释.只需在方法之前键入///,VS就会生成一些xml标记.这些将用于显示工具提示以及参数信息aso.
/// <summary>
/// this will be the tooltip
/// </summary>
/// <param name="args">args will be passed when starting this program</param>
static void Main(string[] args)
{
}
Run Code Online (Sandbox Code Playgroud)
调用方法添加时我的VS2010的屏幕截图.如您所见,显示了xml注释.

Ren*_*iuz 10
是的你可以.下面是一个例子:
/// <summary>
/// My super method
/// </summary>
/// <param name="myNumber">My number parameter</param>
/// <returns>My result</returns>
private int myMethod(int myNumber)
{
return myNumber
}
Run Code Online (Sandbox Code Playgroud)
要自动生成xml注释,只需///在方法,属性,类等上方键入.这里是文档的推荐标记.您也可以使用GhostDoc来简化文档任务.
它称为XML 文档。您必须在方法签名上方写下以下注释:
/// <summary>
/// Performs a custom action: ...
/// </summary>
/// <param name="x">
/// An integer representing the ...
/// </param>
/// <param name="y">
/// A boolean representing the ...
/// </param>
public void MyMethod(int x, bool y) {
//...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
30318 次 |
| 最近记录: |