Assembly: Microsoft.VisualStudio.TextManager.Interop.8.0 (in microsoft.visualstudio.textmanager.interop.8.0.dll)
int OnItemChosen ( /** @attribute InAttribute() */ String pszTitle, /** @attribute InAttribute() */ String pszPath )
[in] A string containing the full name of the code snippet.
[in] A string containing the full path to the snippet file.
Return ValueIf the method succeeds, it returns . If it fails, it returns an error code.
This method is called when the user selects a code snippet from a list of snippets, typically presented in an IntelliSense menu. The menu is shown as a result of a call to themethod in the interface.
A typical implementation of the OnItemChosen method is to call themethod on the object that was cached in the object before the InvokeInsertionUI method was called. In fact, the only time the OnItemChosen method is called is when the InvokeInsertionUI method is called, either as a result of the user selecting a menu option that triggers the call or if the user is allowed to choose from multiple code snippets that have the same name (for example, if a code snippet shortcut matches more than one code snippet, a "disambiguation user interface" is shown to allow the user to select which code snippet to actually insert).