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

 

Called before a command is executed.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public:
virtual bool HandlePreExec(
	Guid% guidCmdGroup,
	unsigned int nCmdId,
	unsigned int nCmdexecopt,
	IntPtr pvaIn,
	IntPtr pvaOut
)

Parameters

guidCmdGroup
Type: System::Guid

[in] The GUID of the command group.

nCmdId
Type: System::UInt32

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

nCmdexecopt
Type: System::UInt32

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

pvaIn
Type: System::IntPtr

[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
Type: System::IntPtr

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

Return Value

Type: System::Boolean

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

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.

Return to top
Show: