Compartir a través de


VsTextViewClass.GetSelection Method

Returns the text span corresponding to the current selection, if there is one.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Syntax

'Declaration
Public Overridable Function GetSelection ( _
    <OutAttribute> ByRef piAnchorLine As Integer, _
    <OutAttribute> ByRef piAnchorCol As Integer, _
    <OutAttribute> ByRef piEndLine As Integer, _
    <OutAttribute> ByRef piEndCol As Integer _
) As Integer
public virtual int GetSelection(
    out int piAnchorLine,
    out int piAnchorCol,
    out int piEndLine,
    out int piEndCol
)
public:
virtual int GetSelection(
    [OutAttribute] int% piAnchorLine, 
    [OutAttribute] int% piAnchorCol, 
    [OutAttribute] int% piEndLine, 
    [OutAttribute] int% piEndCol
)
abstract GetSelection : 
        piAnchorLine:int byref * 
        piAnchorCol:int byref * 
        piEndLine:int byref * 
        piEndCol:int byref -> int  
override GetSelection : 
        piAnchorLine:int byref * 
        piAnchorCol:int byref * 
        piEndLine:int byref * 
        piEndCol:int byref -> int
public function GetSelection(
    piAnchorLine : int, 
    piAnchorCol : int, 
    piEndLine : int, 
    piEndCol : int
) : int

Parameters

  • piAnchorLine
    Type: System.Int32%

    [out] Anchor line position for the selection. Based on user selection, this value is not necessarily the upper line in the selection.

  • piAnchorCol
    Type: System.Int32%

    [out] Anchor column position for the selection. Based on user selection, this value is not necessarily the upper, left column position in the selection. Viewcol coordinates may include virtual space.

  • piEndLine
    Type: System.Int32%

    [out] End line position for the selection. Based on user selection, this value is not necessarily the lower line in the selection.

  • piEndCol
    Type: System.Int32%

    [out] End column position for the selection. Based on user selection, this value is not necessarily the lower, right column position in the selection. Viewcol coordinates may include virtual space.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Implements

IVsTextView.GetSelection(Int32%, Int32%, Int32%, Int32%)

.NET Framework Security

See Also

Reference

VsTextViewClass Class

Microsoft.VisualStudio.TextManager.Interop Namespace