【发布时间】:2011-02-02 14:09:36
【问题描述】:
根据this article,可以获得多行XML cmets——而不是使用///,而是使用/** */。这是我对多行 cmets 是什么以及我想要发生的事情的解释:
/**
* <summary>
* this comment is on line 1 in the tooltip
* this comment is on line 2 in the tooltip
* </summary>
*/
但是,当我使用此表单时,当我将鼠标悬停在我的代码中的类名上时弹出的工具提示是单行的,即看起来就像我这样写评论:
/// <summary>
/// this comment is on line 1 in the tooltip
/// this comment is on line 2 in the tooltip
/// </summary>
这种行为在 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>
当我在我的代码中查看此类的工具提示时,所有内容仍以一行结束... WTH?我在这里做错了吗?
更新
好的,我继续尝试在每一行上添加<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>
【问题讨论】:
-
有谁知道如何在 XML cmets 中保留空格?如果可能的话,我想要缩进。
标签: c# visual-studio-2008 comments multiline xml-comments