Compartilhar via


ExpansionProvider.OnItemChosen Method

Called when an item is chosen in a snippet browser.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)

Syntax

'Declaration
Public Overridable Function OnItemChosen ( _
    pszTitle As String, _
    pszPath As String _
) As Integer
public virtual int OnItemChosen(
    string pszTitle,
    string pszPath
)
public:
virtual int OnItemChosen(
    String^ pszTitle, 
    String^ pszPath
)
abstract OnItemChosen : 
        pszTitle:string * 
        pszPath:string -> int  
override OnItemChosen : 
        pszTitle:string * 
        pszPath:string -> int
public function OnItemChosen(
    pszTitle : String, 
    pszPath : String
) : int

Parameters

  • pszTitle
    Type: String

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

  • pszPath
    Type: String

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

Return Value

Type: Int32
If successful, returns S_OK; otherwise, returns an error code.

Implements

IVsExpansionClient.OnItemChosen(String, String)

Remarks

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.

.NET Framework Security

See Also

Reference

ExpansionProvider Class

Microsoft.VisualStudio.Package Namespace