Metoda VCFileCodeModel.CodeElementFromFullName —

Zwraca kolekcję elementów określonego kodu dla obiektu.

Przestrzeń nazw:  Microsoft.VisualStudio.VCCodeModel
Zestaw:  Microsoft.VisualStudio.VCCodeModel (w Microsoft.VisualStudio.VCCodeModel.dll)

Składnia

'Deklaracja
Function CodeElementFromFullName ( _
    Name As String _
) As CodeElements
CodeElements CodeElementFromFullName(
    string Name
)
CodeElements^ CodeElementFromFullName(
    [InAttribute] String^ Name
)
abstract CodeElementFromFullName : 
        Name:string -> CodeElements
function CodeElementFromFullName(
    Name : String
) : CodeElements

Parametry

  • Name
    Typ: String

    Wymagane.Pełna nazwa elementy do pobrania.

Wartość zwracana

Typ: CodeElements
A CodeElements kolekcji.

Przykłady

W tym przykładzie dodaje klasy i funkcji, pobiera wskaźnik do funkcji przy użyciu CodeElementFromFullNamei dodaje parametr do niej.

Sub AddFunction()
    Dim vcCM As VCCodeModel
    Dim vcClass As VCCodeClass
    Dim vcFunction As VCCodeFunction
    Dim vcParameter As VCCodeParameter
    vcCM = DTE.Solution.Item(1).CodeModel
    vcClass = vcCM.AddClass("MyClass", "MyClass.h")
    vcClass.AddFunction("MyFunction", vsCMFunction.vsCMFunctionFunction, "int")
    vcFunction = vcCM.CodeElementFromFullName("MyClass::MyFunction").Item(1)
    vcParameter = vcFunction.AddParameter("MyParameter", "int")
End Sub

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

VCFileCodeModel Interfejs

Przestrzeń nazw Microsoft.VisualStudio.VCCodeModel