|
---|
<include file='filename' path='tagpath[@name="id"]' /> |
参数
-
filename
-
包含文档的文件名。该文件名可用路径加以限定。将 filename 括在单引号 (' ') 中。
-
tagpath
-
filename 中指向标记 name 的标记路径。将此路径括在单引号中 (' ')。
-
name
-
注释前边的标记中的名称说明符;name 具有一个 id。
-
id
-
位于注释之前的标记的 ID。将此 ID 括在双引号中 (" ")。
备注
示例
以下是一个多文件示例。第一个文件使用 <include>,如下所列:
C# | 复制代码 |
---|
// compile with: /doc:DocFileName.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>
请参见