共用方式為


VCFileCodeModel.CodeElementFromPoint Method (TextPoint, vsCMElement)

Gets a code element at a specific location in a source file.

Namespace:  Microsoft.VisualStudio.VCCodeModel
Assembly:  Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)

Syntax

'宣告
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

Parameters

  • Point
    Type: EnvDTE.TextPoint
    Required. A TextPoint object representing the editor location for which you want a code element.
  • Scope
    Type: EnvDTE.vsCMElement
    Required. A vsCMElement value representing the code element of the specified type that contains the editor location.

Return Value

Type: EnvDTE.CodeElement
A CodeElement object.

Implements

FileCodeModel2.CodeElementFromPoint(TextPoint, vsCMElement)

Remarks

CodeElementFromPoint returns the code element associated with the TextPoint based on the specified scope or granularity of containment. If no code element of the specified type contains the editor location, then CodeElementFromPoint fails.

.NET Framework Security

See Also

Reference

VCFileCodeModel Interface

CodeElementFromPoint Overload

Microsoft.VisualStudio.VCCodeModel Namespace

Other Resources

How to: Compile and Run the Automation Object Model Code Examples