ExpansionProvider.DisplayExpansionBrowser Method
Displays a list of expansion templates of the specified type and kind.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.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.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Syntax
'Declaration
Public Overridable Function DisplayExpansionBrowser ( _
view As IVsTextView, _
prompt As String, _
types As String(), _
includeNullType As Boolean, _
kinds As String(), _
includeNullKind As Boolean _
) As Boolean
public virtual bool DisplayExpansionBrowser(
IVsTextView view,
string prompt,
string[] types,
bool includeNullType,
string[] kinds,
bool includeNullKind
)
public:
virtual bool DisplayExpansionBrowser(
IVsTextView^ view,
String^ prompt,
array<String^>^ types,
bool includeNullType,
array<String^>^ kinds,
bool includeNullKind
)
abstract DisplayExpansionBrowser :
view:IVsTextView *
prompt:string *
types:string[] *
includeNullType:bool *
kinds:string[] *
includeNullKind:bool -> bool
override DisplayExpansionBrowser :
view:IVsTextView *
prompt:string *
types:string[] *
includeNullType:bool *
kinds:string[] *
includeNullKind:bool -> bool
public function DisplayExpansionBrowser(
view : IVsTextView,
prompt : String,
types : String[],
includeNullType : boolean,
kinds : String[],
includeNullKind : boolean
) : boolean
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.Boolean
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.