根据这篇文章,有可能获得多XML注释 - 而不是使用///,使用/** */。这是我的东西多的意见是解释,我想有发生什么:

/**
 * <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?

修改

加布指出,我误会了“多”的意思,而我真正需要使用<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注释必须插入<br/>(“破发”)或换行的<para>(“段”)标签。

其他提示

尝试这

/// <summary>
/// this comment is on line 1 in the tooltip
/// <para>this comment is on line 2 in the tooltip</para>
/// </summary>

...添加<br/>换行或括在<para>...</para>的段落。这就像XML和HTML,线路中断只不过是空白。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top