ExpansionProvider::DisplayExpansionBrowser Method (IVsTextView^, String^, array<String^>^, Boolean, array<String^>^, Boolean)
Displays a list of expansion templates of the specified type and kind.
Assembly: Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)
public: virtual bool DisplayExpansionBrowser( IVsTextView^ view, String^ prompt, array<String^>^ types, bool includeNullType, array<String^>^ kinds, bool includeNullKind )
Parameters
- view
-
Type:
Microsoft.VisualStudio.TextManager.Interop::IVsTextView^
[in] An IVsTextView object that represents the view the source file is in and the view that is the parent of the browser box.
- prompt
-
Type:
System::String^
[in] A string containing the prompt in the browser box.
- types
-
Type:
array<System::String^>^
[in] An array of strings containing the types of expansions to show. If this array is empty or a null value, then all types are shown in the browser box.
- includeNullType
-
Type:
System::Boolean
[in] This is true to allow "empty" types through the filter even if the types array is specified.
- kinds
-
Type:
array<System::String^>^
[in] An array of strings containing the kinds of expansions to show. If this array is empty or a null value, then all kinds are shown in the browser box.
- includeNullKind
-
Type:
System::Boolean
[in] This is true to allow "empty" kinds through the filter even if the kinds array is specified.
Return Value
Type: System::BooleanIf successful, returns true; otherwise, returns false, the browser box was not displayed.
Code snippets are organized by types and kinds. A kind describes what the snippet is; for example, "MethodBody", "Method", and "Type" are all kinds of snippets. A type, on the other hand, describes what the snippet is used for; for example, "SurroundsWith" (surrounds the selected text with the snippet) and "Expansion" (inserts and expands the snippet at the current location) are two types of snippets. See for details on snippet kinds. See for details on snippet types.6d1301d2-d621-4183-a104-ad5ad559f8511a7a93ab-1af1-4f38-babf-a9aa5315b45c
The base method obtains the IVsTextManager2 object from the SVsTextManager service and calls the GetExpansionManager method on the IVsTextManager2object to obtain an IVsExpansionManager object. The base method then calls the InvokeInsertionUI method on the IVsExpansionManager object. The base method returns true if the InvokeInsertionUI method succeeded. If a previous expansion session was active, the base method calls the EndTemplateEditing method first before calling InvokeInsertionUI.