本文介绍了< example></example> XML注释标签:怎么看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Microsoft Visual Studio 2012.当我将代码示例放入C#类/方法的XML注释中时,我想知道:引用我的程序集的用户将如何看到该代码示例?

I use Microsoft Visual Studio 2012.When I put code examples into XML comments of C# classes/methods, I wonder: how will user that references my assemblies see that code example?

我试图引用自己的程序集,而发现的唯一方法是:查看assembly.xml文件.我可以解决Visual Studio或其他问题,看看这些代码示例吗?

I tried to reference my own assembly, and the only way I found was: to look at assembly.xml file.Can I settle Visual Studio or anything else to see those code examples?

以下是我的评论:

/// <summary>
/// This is my method example
/// </summary>
/// <example>
/// <code>
/// // Here is my code example. Call my method like this:
/// const int a = 10;
/// MethodExample(a);
/// </code>
/// </example>
public static void MethodExample(int parameter)
{
}

这是我在智能感知中得到的:

Here is what I get in intellisense:

这是我在对象浏览器中得到的:

Here is what I get in object browser:

这是我在assembly.xml文件中得到的内容:

Here is what I get in assembly.xml file:

我想要得到的:在对象浏览器和智能感知中查看代码示例.

What I'd like to get: see code examples in object browser and intellisense.

推荐答案

许多XML注释标签仅作为其他标签的子元素出现在IntelliSense中.这些标记称为ChildCompletionList标记,包括:c,代码,示例,列表,listheader,para,paramref,另请参见.

A number of XML comment tags appear in IntelliSense only as child elements of other tags. These tags, known as ChildCompletionList tags, are: c, code, example, list, listheader, para, paramref, see and see also.

/// <summary>
/// MethodExample the function that does it all...
/// <example>
/// <code>
/// <para/>// Here is my code example. Call my method like this:
/// <para/>const int a = 10;
/// <para/>MethodExample(a);
/// </code>
/// </example>
/// </summary>

这篇关于&lt; example&gt;&lt;/example&gt; XML注释标签:怎么看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 14:56