VCFileCodeModel.CodeElementFromFullName メソッド

オブジェクトの指定したコード要素のコレクションを取得します。

名前空間 :  Microsoft.VisualStudio.VCCodeModel
アセンブリ :  Microsoft.VisualStudio.VCCodeModel (Microsoft.VisualStudio.VCCodeModel.dll 内)

構文

'宣言
Function CodeElementFromFullName ( _
    Name As String _
) As CodeElements
'使用
Dim instance As VCFileCodeModel
Dim Name As String
Dim returnValue As CodeElements

returnValue = instance.CodeElementFromFullName(Name)
CodeElements CodeElementFromFullName(
    string Name
)
CodeElements^ CodeElementFromFullName(
    [InAttribute] String^ Name
)
function CodeElementFromFullName(
    Name : String
) : CodeElements

パラメータ

  • Name
    型 : System.String

    必ず指定します。取得する要素の名前全体を指定します。

戻り値

型 : EnvDTE.CodeElements

CodeElements コレクション。

この例では、クラスと関数を追加し、CodeElementFromFullName を使用して関数へのポインタを取得し、パラメータを追加します。

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

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

VCFileCodeModel インターフェイス

VCFileCodeModel メンバ

Microsoft.VisualStudio.VCCodeModel 名前空間