共用方式為


IVsExpansionClient.PositionCaretForEditing Method

Called to position the edit caret in the specified place in a code snippet after it has been inserted and formatted.

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

Syntax

'宣告
Function PositionCaretForEditing ( _
    pBuffer As IVsTextLines, _
    ts As TextSpan() _
) As Integer
int PositionCaretForEditing(
    IVsTextLines pBuffer,
    TextSpan[] ts
)
int PositionCaretForEditing(
    [InAttribute] IVsTextLines^ pBuffer, 
    [InAttribute] array<TextSpan>^ ts
)
abstract PositionCaretForEditing : 
        pBuffer:IVsTextLines * 
        ts:TextSpan[] -> int 
function PositionCaretForEditing(
    pBuffer : IVsTextLines, 
    ts : TextSpan[]
) : int

Parameters

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 textmgr2.idl:

HRESULT IVsExpansionClient::PositionCaretForEditing(
   [in]IVsTextLines *pBuffer,
   [in]TextSpan *ts
);

This method is called after the edit caret has been positioned according to the notations in the code snippet file. This method provides an opportunity to override the normal placement of the edit caret but is rarely used.

.NET Framework Security

See Also

Reference

IVsExpansionClient Interface

Microsoft.VisualStudio.TextManager.Interop Namespace