Sdílet prostřednictvím


ExpansionProvider.DisplayExpansionBrowser Method

Definition

Displays a list of expansion templates of the specified type and kind.

public:
 virtual bool DisplayExpansionBrowser(Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ view, System::String ^ prompt, cli::array <System::String ^> ^ types, bool includeNullType, cli::array <System::String ^> ^ kinds, bool includeNullKind);
public:
 virtual bool DisplayExpansionBrowser(Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ view, Platform::String ^ prompt, Platform::Array <Platform::String ^> ^ types, bool includeNullType, Platform::Array <Platform::String ^> ^ kinds, bool includeNullKind);
 virtual bool DisplayExpansionBrowser(Microsoft::VisualStudio::TextManager::Interop::IVsTextView const & view, std::wstring const & prompt, std::Array <std::wstring const &> const & types, bool includeNullType, std::Array <std::wstring const &> const & kinds, bool includeNullKind);
public virtual bool DisplayExpansionBrowser (Microsoft.VisualStudio.TextManager.Interop.IVsTextView view, string prompt, string[] types, bool includeNullType, string[] kinds, bool includeNullKind);
abstract member DisplayExpansionBrowser : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * string * string[] * bool * string[] * bool -> bool
override this.DisplayExpansionBrowser : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * string * string[] * bool * string[] * bool -> bool
Public Overridable Function DisplayExpansionBrowser (view As IVsTextView, prompt As String, types As String(), includeNullType As Boolean, kinds As String(), includeNullKind As Boolean) As Boolean

Parameters

view
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
String

[in] A string containing the prompt in the browser box.

types
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
Boolean

[in] This is true to allow "empty" types through the filter even if the types array is specified.

kinds
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
Boolean

[in] This is true to allow "empty" kinds through the filter even if the kinds array is specified.

Returns

If successful, returns true; otherwise, returns false, the browser box was not displayed.

Remarks

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 Code Element (Intellisense Code Snippets) for details on snippet kinds. See SnippetType Element (Intellisense Code Snippets) for details on snippet types.

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.

Applies to