VsTextViewClass.GetSelection 方法

,如果有一个,返回文本范围与当前选择对应。

命名空间:  Microsoft.VisualStudio.TextManager.Interop
程序集:  Microsoft.VisualStudio.TextManager.Interop(在 Microsoft.VisualStudio.TextManager.Interop.dll 中)

语法

声明
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

参数

  • piAnchorLine
    类型:Int32%

    [out] 定位点选择的行位置。 基于用户的选择,此值不一定是在选定内容顶行。

  • piAnchorCol
    类型:Int32%

    [out] 定位点选择的列位置。 基于用户的选择,此值不一定是在选定内容的顶部,左列位置。 Viewcol 坐标可以包括虚拟空间。

  • piEndLine
    类型:Int32%

    [out] 结束选择的行位置。 基于用户的选择,此值不一定是在选定内容的下半部分行。

  • piEndCol
    类型:Int32%

    [out] 选择的结尾列位置。 基于用户的选择,此值不一定是在选定内容的更低,正确的列位置。 Viewcol 坐标可以包括虚拟空间。

返回值

类型:Int32

实现

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

.NET Framework 安全性

请参阅

参考

VsTextViewClass 类

Microsoft.VisualStudio.TextManager.Interop 命名空间