次の方法で共有


VCFileCodeModel.CodeElementFromPoint メソッド (TextPoint, vsCMElement)

ソース ファイルの特定の位置にあるコード要素を取得します。

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

構文

'宣言
Function CodeElementFromPoint ( _
    Point As TextPoint, _
    Scope As vsCMElement _
) As CodeElement
CodeElement CodeElementFromPoint(
    TextPoint Point,
    vsCMElement Scope
)
CodeElement^ CodeElementFromPoint(
    TextPoint^ Point, 
    vsCMElement Scope
)
abstract CodeElementFromPoint : 
        Point:TextPoint * 
        Scope:vsCMElement -> CodeElement 
function CodeElementFromPoint(
    Point : TextPoint, 
    Scope : vsCMElement
) : CodeElement

パラメーター

  • Point
    型: EnvDTE.TextPoint
    必ず指定します。コード要素のエディターの位置を表す TextPoint オブジェクト。
  • Scope
    型: EnvDTE.vsCMElement
    必ず指定します。エディターの位置を含む、指定した種類のコード要素を表す vsCMElement 値。

戻り値

型: EnvDTE.CodeElement
CodeElement オブジェクト。

実装

FileCodeModel2.CodeElementFromPoint(TextPoint, vsCMElement)

解説

CodeElementFromPoint は、指定したスコープまたはコンテインメントの単位に基づいて、TextPoint に関連付けられたコード要素を返します。 エディターの位置が含まれる指定した種類のコード要素がない場合、CodeElementFromPoint は失敗します。

.NET Framework セキュリティ

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

参照

参照

VCFileCodeModel インターフェイス

CodeElementFromPoint オーバーロード

Microsoft.VisualStudio.VCCodeModel 名前空間

その他の技術情報

方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する