IVsTextManager2.NavigateToLineAndColumn2 Method

Finds or creates an appropriate view on the specified buffer and places the selection at the specified location.

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

Syntax

声明
Function NavigateToLineAndColumn2 ( _
    pBuffer As IVsTextBuffer, _
    ByRef guidDocViewType As Guid, _
    iStartRow As Integer, _
    iStartIndex As Integer, _
    iEndRow As Integer, _
    iEndIndex As Integer, _
    grfIncludeViewFrameType As UInteger _
) As Integer
用法
Dim instance As IVsTextManager2
Dim pBuffer As IVsTextBuffer
Dim guidDocViewType As Guid
Dim iStartRow As Integer
Dim iStartIndex As Integer
Dim iEndRow As Integer
Dim iEndIndex As Integer
Dim grfIncludeViewFrameType As UInteger
Dim returnValue As Integer

returnValue = instance.NavigateToLineAndColumn2(pBuffer, _
    guidDocViewType, iStartRow, iStartIndex, _
    iEndRow, iEndIndex, grfIncludeViewFrameType)
int NavigateToLineAndColumn2(
    IVsTextBuffer pBuffer,
    ref Guid guidDocViewType,
    int iStartRow,
    int iStartIndex,
    int iEndRow,
    int iEndIndex,
    uint grfIncludeViewFrameType
)
int NavigateToLineAndColumn2(
    [InAttribute] IVsTextBuffer^ pBuffer, 
    [InAttribute] Guid% guidDocViewType, 
    [InAttribute] int iStartRow, 
    [InAttribute] int iStartIndex, 
    [InAttribute] int iEndRow, 
    [InAttribute] int iEndIndex, 
    [InAttribute] unsigned int grfIncludeViewFrameType
)
abstract NavigateToLineAndColumn2 : 
        pBuffer:IVsTextBuffer * 
        guidDocViewType:Guid byref * 
        iStartRow:int * 
        iStartIndex:int * 
        iEndRow:int * 
        iEndIndex:int * 
        grfIncludeViewFrameType:uint32 -> int 
function NavigateToLineAndColumn2(
    pBuffer : IVsTextBuffer, 
    guidDocViewType : Guid, 
    iStartRow : int, 
    iStartIndex : int, 
    iEndRow : int, 
    iEndIndex : int, 
    grfIncludeViewFrameType : uint
) : int

Parameters

  • iStartRow
    Type: System.Int32
    [in] Starting line for the selection to locate.
  • iStartIndex
    Type: System.Int32
    [in] Starting index for the selection to locate.
  • iEndRow
    Type: System.Int32
    [in] Ending line for the selection to locate.
  • iEndIndex
    Type: System.Int32
    [in] Ending index for the selection to locate.

Return Value

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

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsTextManager2::NavigateToLineAndColumn2(
   [in] IVsTextBuffer* pBuffer,
   [in] REFGUID guidDocViewType,
   [in] long iStartRow,
   [in] CharIndex iStartIndex,
   [in] long iEndRow,
   [in] CharIndex iEndIndex,
   [in] VIEWFRAMETYPE grfIncludeViewFrameType
);

To use this method, pass in a pointer to a text buffer and a line/column position in that buffer. The method then locates the buffer, displays a view if the view is not currently active, and then places selection at the specified span of text.

.NET Framework Security

See Also

Reference

IVsTextManager2 Interface

IVsTextManager2 Members

Microsoft.VisualStudio.TextManager.Interop Namespace