다음을 통해 공유


CodeClass2.DocComment 속성

코드 클래스에 대한 문서 주석을 가져오거나 설정합니다.

네임스페이스:  EnvDTE80
어셈블리:  EnvDTE80(EnvDTE80.dll)

구문

‘선언
Property DocComment As String
string DocComment { get; set; }
property String^ DocComment {
    String^ get ();
    void set (String^ value);
}
abstract DocComment : string with get, set
function get DocComment () : String 
function set DocComment (value : String)

속성 값

형식: String
문서 주석을 나타내는 문자열입니다.

설명

DocComment 속성은 코드 클래스에 있는 특수한 문서 주석이나 특성을 반환합니다. 코드 모델을 구현하는 언어에 문서 주석 메커니즘이 없거나 코드 클래스와 관련된 문서 주석이나 특성이 없으면 DocComment에서 빈 문자열을 반환합니다.

참고

클래스, 구조체, 함수, 특성, 대리자 등의 코드 모델 요소를 특정한 방식으로 편집한 후에는 요소의 값이 명확하지 않을 수 있습니다. 즉, 요소의 값이 항상 같다고 할 수 없습니다.자세한 내용은 코드 모델을 사용하여 코드 검색(Visual Basic)의 "코드 모델 요소 값이 변경될 수 있음" 단원을 참조하십시오.

예제

[C#]

public void CodeClass2DocCommentExample(DTE2 dte2)
{
    // Before running this example, open a code document from a project
    // and place the insertion point within a class definition.
    try
    {   // Get the CodeClass2 at the insertion point.
        TextSelection sel = 
        (TextSelection)dte2.ActiveDocument.Selection;
        CodeClass2 cls = (CodeClass2)sel.ActivePoint.get_CodeElement(
            vsCMElement.vsCMElementClass);

        // Set the document comment for the CodeClass.
        cls.DocComment = "<doc>This is a DocComment\r\n</doc>";

    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
    }
}

.NET Framework 보안

참고 항목

참조

CodeClass2 인터페이스

EnvDTE80 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행

코드 모델을 사용하여 코드 검색(Visual Basic)

코드 모델을 사용하여 코드 검색(Visual C#)