Partilhar via


ExpansionProvider.HandlePreExec(Guid, UInt32, UInt32, IntPtr, IntPtr) Method

Definition

Called before a command is executed.

public:
 virtual bool HandlePreExec(Guid % guidCmdGroup, System::UInt32 nCmdId, System::UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut);
public virtual bool HandlePreExec (ref Guid guidCmdGroup, uint nCmdId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut);
abstract member HandlePreExec : Guid * uint32 * uint32 * nativeint * nativeint -> bool
override this.HandlePreExec : Guid * uint32 * uint32 * nativeint * nativeint -> bool
Public Overridable Function HandlePreExec (ByRef guidCmdGroup As Guid, nCmdId As UInteger, nCmdexecopt As UInteger, pvaIn As IntPtr, pvaOut As IntPtr) As Boolean

Parameters

guidCmdGroup
Guid

[in] The GUID of the command group.

nCmdId
UInt32

[in] The specific ID of the command from the command group. This identifies the command to execute.

nCmdexecopt
UInt32

[in] Additional parameters for the command (packed into a 32-bit value).

pvaIn
IntPtr

nativeint

[in] An unmarshaled pointer to a Variant holding any parameters required by the command. This can be a null value indicating there are no additional parameters.

pvaOut
IntPtr

nativeint

[in, out] An unmarshaled pointer to a Variant to hold the result of the command, if any.

Returns

If the command was handled, returns true; otherwise, returns false to let the caller handle the command.

Remarks

This method is called before a command is executed. For an expansion provider, this provides the opportunity to interact with an expansion session.

The base method does nothing if an expansion session has not been started or there is an IntelliSense completer list box active. Otherwise, this method handles the following key commands.

Command Description
CANCEL Ends the snippet session by calling the EndTemplateEditing method, leaving the caret where the template put it.
RETURN If a completer list box is not active, ends the snippet session by calling the EndTemplateEditing method, leaving the caret where the user put it.
BACKTAB Moves focus to the previous field by calling the GoToPreviousExpansionField method on the IVsExpansionSession object.
TAB Moves focus to the next field by calling the GoToNextExpansionField method on the IVsExpansionSession object.

Applies to