<typeparam name="name">description</typeparam>
参数
name
类型参数的名称。将此名称用双引号括起来 (" ")。
description
类型参数的说明。
备注
在泛型类型或方法声明的注释中应该使用 <typeparam> 标记描述类型参数。为泛型类型或方法的每个类型参数添加标记。
有关更多信息,请参见泛型(C# 编程指南)。
<typeparam> 标记的文本将显示在对象浏览器代码注释 Web 报表 IntelliSense 中。
使用 /doc 进行编译可以将文档注释处理到文件中。
有关显示如何使用 <typeparam> 的代码示例,请参见 <typeparamref>(C# 编程指南)。
<include>(C# 编程指南)
<include file=\’filename\’ path=\’tagpath[@name="id"]\’ />
参数
filename
包含文档的文件名。该文件名可用路径加以限定。将 filename 括在单引号 (\’ \’) 中。
tagpath
filename 中指向标记 name 的标记路径。将此路径括在单引号中 (\’ \’)。
name
注释前边的标记中的名称说明符;name 具有一个 id。
id
位于注释之前的标记的 ID。将此 ID 括在双引号中 (" ")。
备注
<include> 标记使您得以引用描述源代码中类型和成员的另一文件中的注释。这是除了将文档注释直接置于源代码文件中之外的另一种可选方法。
<include> 标记使用 XML XPath 语法。有关自定义 <include> 使用的方法,请参见 XPath 文档。
示例
以下是一个多文件示例。第一个文件使用 <include>,如下所列:
C#
// compile with: /dococFileName.xml
/// <include file=\’xml_include_tag.doc\’ path=\’MyDocs/MyMembers[@name="test"]/*\’ />
class Test
{
static void Main()
{
}
}
/// <include file=\’xml_include_tag.doc\’ path=\’MyDocs/MyMembers[@name="test2"]/*\’ />
class Test2
{
public void test()
{
}
}
第二个文件 xml_include_tag.doc 包含下列文档注释:
<MyDocs>
<MyMembers name="test">
<summary>
The summary for this type.
</summary>
</MyMembers>
<MyMembers name="test2">
<summary>
The summary for this other type.
</summary>
</MyMembers>
</MyDocs>
程序输出
<?xml version="1.0"?>
<doc>
<assembly>
<name>xml_include_tag</name>
</assembly>
<members>
<member name="T:Test">
<summary>
The summary for this type.
</summary>
</member>
<member name="T:Test2">
<summary>
The summary for this other type.
</summary>
</member>
</members>
</doc>
<remarks>(C# 编程指南)
<remarks>description</remarks>
参数
Description
成员的说明。
备注
<remarks> 标记用于添加有关某个类型的信息,从而补充由 <summary> 所指定的信息。此信息显示在对象浏览器中。
使用 /doc 进行编译可以将文档注释处理到文件中。
示例
C#
// compile with: /dococFileName.xml
/// <summary>
/// You may have some primary information about this class.
/// </summary>
/// <remarks>
/// You may have some additional information about this class.
/// </remarks>
public class TestClass
{
/// text for Main
static void Main()
{
}
}
<typeparamref>(C# 编程指南)
<typeparamref name="name"/>
参数
name
类型参数的名称。将此名称用双引号括起来 (" ")。
备注
有关泛型类型和方法中的类型参数的更多信息,请参见泛型。
使用此标记,文档文件的使用者能够以某种独特的方式设置单词的格式,例如以斜体显示。
使用 /doc 进行编译可以将文档注释处理到文件中。
示例
C#
// compile with: /dococFileName.xml
/// comment for class
public class TestClass
{
/// <summary>
/// Creates a new array of arbitrary type <typeparamref name="T"/>
/// </summary>
/// <typeparam name="T">The element type of the array</typeparam>
public static T[] mkArray<T>(int n)
{
return new T[n];
}
}
<list>(C# 编程指南)
<list type="bullet" | "number" | "table">
<listheader>
<term>term</term>
<description>description</description>
</listheader>
<item>
<term>term</term>
<description>description</description>
</item>
</list>
参数
term
要定义的项,该项将在 description 中定义。
description
项目符号列表或编号列表中的项或者 term 的定义。
备注
<listheader> 块用于定义表或定义列表中的标题行。定义表时,只需为标题中的项提供一个项。
列表中的每一项都用一个 <item> 块来描述。创建定义列表时,既需要指定 term 也需要指定 description。但是,对于表、项目符号列表或编号列表,只需为 description 提供一个项。
列表或表所拥有的 <item> 块数可以根据需要而定。
使用 /doc 进行编译可以将文档注释处理到文件中。
示例
C#
// compile with: /dococFileName.xml
/// text for class TestClass
public class TestClass
{
/// <summary>Here is an example of a bulleted list:
/// <list type="bullet">
/// <item>
///
转载于:https://www.cnblogs.com/greatwang/archive/2011/11/09/2648250.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。