Dav*_*ave 26 c# comments multiline xml-comments visual-studio-2008
根据这篇文章,可以获得多行XML注释 - 而不是使用///,使用/** */.这是我对多行注释的解释,以及我想要发生的事情:
/**
* <summary>
* this comment is on line 1 in the tooltip
* this comment is on line 2 in the tooltip
* </summary>
*/
Run Code Online (Sandbox Code Playgroud)
但是,当我使用这个表单时,当我将鼠标悬停在我的代码中时弹出的工具提示是单行的,即它看起来就像我写了这样的评论:
/// <summary>
/// this comment is on line 1 in the tooltip
/// this comment is on line 2 in the tooltip
/// </summary>
Run Code Online (Sandbox Code Playgroud)
这种行为实际上是否仍然可以在VS2008中使用?
编辑
gabe指出我误解了"多线"意味着什么,我实际上需要使用<para>或<br>获得我想要的效果.我继续使用,<br>因为我想控制断线发生的位置,即
/// <summary>
/// this comment is on line 1 in the tooltip<br/>
/// this comment is on line 2 in the tooltip<br/>
/// </summary>
Run Code Online (Sandbox Code Playgroud)
当我在我的代码中查看此类的工具提示时,所有内容仍然会在一行中结束... WTH?我在这里做错了吗?
UPDATE
好的,我继续<para>在每一行上尝试标记,这是有效的.不知道为什么<br/>不.
/// <summary>
/// <para>this comment is on line 1 in the tooltip</para>
/// <para>this comment is on line 2 in the tooltip</para>
/// </summary>
Run Code Online (Sandbox Code Playgroud)
Gab*_*abe 16
听起来你对"多线"意味着什么感到困惑.单行注释在源代码行的末尾结束,如果要继续该注释,则必须///在下一行添加" ".多行注释以" /*" 开头,以" "结尾,*/因此它可以在同一行或多行中结束.
作为"多行",没有说明评论中的文本是如何显示的.要在XML注释中添加换行符,必须插入<br/>("break")或将行包装在<para>("paragraph")标记中.
bic*_*bic 14
试试这个
/// <summary>
/// this comment is on line 1 in the tooltip
/// <para>this comment is on line 2 in the tooltip</para>
/// </summary>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12506 次 |
| 最近记录: |