Share via


CodeFunction2.Prototype 속성 (Int32)

이 개체의 스텁 정의가 들어 있는 문자열을 가져옵니다.

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

구문

‘선언
ReadOnly Property Prototype ( _
    Flags As Integer _
) As String
    Get
string this[
    int Flags
] { get; }
property String^ Prototype[[InAttribute] int Flags] {
    String^ get ([InAttribute] int Flags);
}
abstract Prototype : string
JScript에서는 인덱싱된 속성을 지원하지 않습니다.

매개 변수

  • Flags
    형식: System.Int32
    선택적 요소로서,매개 변수 이름, 매개 변수 형식, 고유한 시그니처 등과 같은 문자열 내용을 나타내는 vsCMPrototype 값입니다.기본적으로 모든 플래그는 Off로 설정되어 있습니다.

속성 값

형식: System.String
CodeFunction의 스텁 정의입니다.

구현

CodeFunction.Prototype[Int32]

설명

참고

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

예제

Sub PrototypeExample(ByVal dte As DTE2)

    ' Before running this example, open a code document from a project
    ' and place the insertion point inside a function.
    Try
        ' Retrieve the CodeFunction at the insertion point.
        Dim sel As TextSelection = _
            CType(dte.ActiveDocument.Selection, TextSelection)
        Dim fun As CodeFunction = _
            CType(sel.ActivePoint.CodeElement( _
            vsCMElement.vsCMElementFunction), CodeFunction)

        Dim ovrloads As String
        If fun.IsOverloaded Then
            ' Display all the overloads.
            Dim ovrload As CodeFunction
            For Each ovrload In fun.Overloads
                ovrloads &= ovrload.Prototype( _
                    vsCMPrototype.vsCMPrototypeParamNames Or _
                    vsCMPrototype.vsCMPrototypeParamTypes Or _
                    vsCMPrototype.vsCMPrototypeType) & vbCrLf
            Next
            MsgBox(fun.Name & " has the following overloads:" & _
                vbCrLf & vbCrLf & ovrloads)
        Else
            MsgBox(fun.Name & " isn't overloaded.")
        End If
    Catch ex As Exception
        MsgBox(ex.Message)
    End Try

End Sub
public void PrototypeExample(DTE2 dte)
{
    // Before running this example, open a code document from a project
    // and place the insertion point inside a function.
    try
    {
        // Retrieve the CodeFunction at the insertion point.
        TextSelection sel = 
            (TextSelection)dte.ActiveDocument.Selection;
        CodeFunction fun = 
            (CodeFunction)sel.ActivePoint.get_CodeElement(
            vsCMElement.vsCMElementFunction);
        string ovrloads = "";

        if (fun.IsOverloaded)
        {
            // Display all the overloads.
            foreach (CodeFunction ovrload in fun.Overloads)
            {
                ovrloads += ovrload.get_Prototype(
                    (int)(vsCMPrototype.vsCMPrototypeParamNames | 
                    vsCMPrototype.vsCMPrototypeParamTypes | 
                    vsCMPrototype.vsCMPrototypeType)) + "\n";
            }

            MessageBox.Show(fun.Name + 
                " has the following overloads:\n\n" + ovrloads);
        }
        else
        {
            MessageBox.Show(fun.Name + " isn't overloaded.");
        }
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

CodeFunction2 인터페이스

Prototype 오버로드

EnvDTE80 네임스페이스

기타 리소스

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

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

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