다음을 통해 공유


<include>(C# 프로그래밍 가이드)

업데이트: 2007년 11월

<include file='filename' path='tagpath[@name="id"]' />

매개 변수

  • filename
    문서를 포함할 파일 이름입니다. 파일 이름은 path로 한정될 수 있습니다. filename은 작은따옴표(' ')로 묶습니다.

  • tagpath
    name 태그를 찾을 수 있는 filename의 태그 경로입니다. path는 작은따옴표(' ')로 묶습니다.

  • name
    주석 앞에 오는 태그의 이름 지정자입니다. name에는 id가 있어야 합니다.

  • id
    주석 앞에 오는 태그의 ID입니다. ID는 큰따옴표(" ")로 묶습니다.

설명

<include> 태그를 사용하면 소스 코드의 형식과 멤버를 설명하는 다른 파일의 주석을 참조할 수 있습니다. 이렇게 하면 소스 코드 파일에 직접 문서 주석을 배치하지 않아도 됩니다.

<include> 태그는 XML XPath 구문을 사용합니다. <include>의 용도를 변경하는 방법은 XPath 문서를 참조하십시오.

예제

아래 예제는 여러 개의 파일로 구성됩니다. <include>를 사용하는 첫째 파일은 아래와 같습니다.

// 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>

참고 항목

개념

C# 프로그래밍 가이드

참조

문서 주석에 대한 권장 태그(C# 프로그래밍 가이드)