Partager via


IVsExpansionSession.EndCurrentExpansion(Int32) Method

Definition

Called to indicate the end of the current code snippet insertion process.

public:
 int EndCurrentExpansion(int fLeaveCaret);
public:
 int EndCurrentExpansion(int fLeaveCaret);
int EndCurrentExpansion(int fLeaveCaret);
public int EndCurrentExpansion (int fLeaveCaret);
abstract member EndCurrentExpansion : int -> int
Public Function EndCurrentExpansion (fLeaveCaret As Integer) As Integer

Parameters

fLeaveCaret
Int32

[in] Non-zero (TRUE) if to leave the edit caret where it is; otherwise, zero (FALSE) if the edit caret should be positioned according to the code snippet template.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr2.idl:

HRESULT IVsExpansionSession::EndCurrentExpansion(  
   [in]bool fLeaveCaret  
);  

A code snippet template typically marks where the edit caret should be positioned after the snippet has been inserted and the special edit mode is completed. This method is called during the special edit mode when the user types the Enter or ESC keys. If Enter is typed, the fLeaveCaret parameter should be set to non-zero (TRUE) and if ESC is typed, the fLeaveCaret parameter should be set to zero (FALSE). This method positions the caret appropriately in the associated text view before returning.

Applies to