Tin*_*ker 180 .net c# xml-documentation
这应该更容易...
我想在我的代码中为XML文档添加"编码"换行符
/// <summary>
/// Get a human-readable variant of the SQL WHERE statement of the search element. <br/>
/// Rather than return SQL, this method returns a string with icon-tokens, which
/// could be used to represent the search in a condensed pictogram format.
/// </summary>
Run Code Online (Sandbox Code Playgroud)
如您所见,我找到了一些答案,证明添加了<和>括号.有趣的是,好的'ol <br />换行符不会在Intellisense弹出窗口中创建换行符.
我发现这很烦人......
有什么建议?
pst*_*jds 297
您可以使用<para />标记来生成分段符,或者可以将<para></para>标记中的文本作为对文本进行分组并在其后添加空行的方式,但是没有相应的<br />或类似的东西.(根据这个旧的MS论坛帖子是设计的.)您可以从MS的本文档文章中获取可用标签的列表.记录您的代码
示例(基于原始OP样本):
/// <summary>
/// <para>Get a human-readable variant of the SQL WHERE statement of the search element.</para>
/// Rather than return SQL, this method returns a string with icon-tokens, which
/// could be used to represent the search in a condensed pictogram format.
/// </summary>
Run Code Online (Sandbox Code Playgroud)
小智 65
这是我的用法,比如<br/>,它的工作:)
/// <summary>
/// Value: 0/1/2
/// <para/>0 foo,
/// <para/>1 bar,
/// <para/>2 other
/// </summary>
Run Code Online (Sandbox Code Playgroud)
Joe*_*oel 26
添加一个<para>带有特殊字符的标记,255个字符或不可见的字符.
/// <summary>
/// Some text
/// <para> </para>
/// More text
/// </summary>
/// <param name="str">Some string</param>
public void SomeMethod(string str) { }
Run Code Online (Sandbox Code Playgroud)
它会像这样工作:

小智 15
从Visual Studio 2019开始,使用<br/>注释功能可以使用新行创建注释。
例如:
/// <summary>
/// This is a comment.<br/>
/// This is another comment <br/>
/// This is a long comment so i want it to continue <br/> on another line.
/// </summary>
Run Code Online (Sandbox Code Playgroud)
您可以在下图中看到上面的示例。
请注意,与使用<br/>标签相比,使用<para>标签时没有添加额外的行。
<br></br>并且<br />似乎不起作用,有时它并不是真正将<para>句子分开,而是希望有一个空行来分隔关注点。我在这里提到这一点是因为这个问题似乎是许多此类性质的封闭问题的根源。
我发现唯一有效的是
<para> </para>
Run Code Online (Sandbox Code Playgroud)
例如
/// <summary>
/// <para>
/// "This sentence shows up when the type is hovered"
/// </para>
/// <para> </para>
/// <para>int PrimaryKey</para>
/// <para> </para>
/// <para>virtual Relation Relation</para>
/// </summary>
Run Code Online (Sandbox Code Playgroud)
结果是
"This sentence shows up when the type is hovered"
int PrimaryKey
virtual Relation Relation
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
58844 次 |
| 最近记录: |