VCFileCodeModel.CodeElementFromPoint 方法

获取源文件中指定位置处的代码元素。

命名空间:  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

参数

返回值

类型:EnvDTE.CodeElement
一个 CodeElement 对象。

备注

根据指定的包容范围或粒度,CodeElementFromPoint 返回与 TextPoint 关联的代码元素。如果指定类型的代码元素不包含编辑器位置,则 CodeElementFromPoint 失败。

.NET Framework 安全性

请参见

参考

VCFileCodeModel 接口

Microsoft.VisualStudio.VCCodeModel 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例