ExpansionProvider.OnItemChosen Method (String, String)


Called when an item is chosen in a snippet browser.

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

public virtual int OnItemChosen(
	string pszTitle,
	string pszPath


Type: System.String

[in] A string containing the name of the snippet that was selected.

Type: System.String

[in] A string containing the path to the snippet template file.

Return Value

Type: System.Int32

If successful, returns S_OK; otherwise, returns an error code.

This method is an implementation of the OnItemChosen method on the IVsExpansionClient interface.

The base method gets the current caret position from the IVsTextView object passed to the InsertSpecificExpansion or InsertNamedExpansion methods and then calls the InsertNamedExpansion method on the IVsExpansionClient object, returning the success code from that call to the InsertNamedExpansion method.

Return to top