请单击以进行评分并提供反馈
MSDN
MSDN Library
Visual C#
C# 编程指南
XML 文档注释
 <include>

  开启低带宽视图
此页面仅适用于
Microsoft Visual Studio 2005/.NET Framework 2.0

同时提供下列产品的其他版本:
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: /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>

社区内容   什么是社区内容?
添加新内容 RSS  批注
Processing
© 2009 Microsoft Corporation 版权所有。 保留所有权利  |  商标  |  隐私权声明
Page view tracker