This documentation is archived and is not being maintained.

IVsExpansionManager.EnumerateExpansions Method

Retrieves a list of code snippets for the specified coding language.

Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop.8.0 (in microsoft.visualstudio.textmanager.interop.8.0.dll)

int EnumerateExpansions (
	[InAttribute] Guid guidLang,
	[InAttribute] int fShortCutOnly,
	[InAttribute] string[] bstrTypes,
	[InAttribute] int iCountTypes,
	[InAttribute] int fIncludeNULLType,
	[InAttribute] int fIncludeDuplicates,
	out IVsExpansionEnumeration pEnum
)
int EnumerateExpansions (
	/** @attribute InAttribute() */ Guid guidLang, 
	/** @attribute InAttribute() */ int fShortCutOnly, 
	/** @attribute InAttribute() */ String[] bstrTypes, 
	/** @attribute InAttribute() */ int iCountTypes, 
	/** @attribute InAttribute() */ int fIncludeNULLType, 
	/** @attribute InAttribute() */ int fIncludeDuplicates, 
	/** @attribute OutAttribute() */ /** @ref */ IVsExpansionEnumeration pEnum
)
JScript does not support passing value-type arguments by reference.

Parameters

guidLang

[in] The GUID of the coding language (typically, this is the language service GUID).

fShortCutOnly

[in] Non-zero (TRUE) if to retrieve only the shortcut name for each snippet; otherwise, zero (FALSE) to retrieve all information.

bstrTypes

[in] An array strings specifying snippet types to obtain. This can be a null value if iCountTypes is 0. See Remarks.

iCountTypes

[in] The number of types specified in the bstrTypes array. If this is 0, all types are returned.

fIncludeNULLType

[in] Non-zero (TRUE) if to include code snippets with "empty" types in the bstrTypes list (this parameter is ignored if iCountTypes is 0).

fIncludeDuplicates

[in] Non-zero (TRUE) if to include duplicate snippets; otherwise, duplicates are left out.

pEnum

[out] An IVsExpansionEnumeration object that contains the desired list of snippets.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From textmgr2.idl:

HRESULT     EnumerateExpansions(
   [in]GUID guidLang,
   [in] bool fShortCutOnly,
   [in, size_is(iCountTypes)] BSTR *bstrTypes,
   [in] long iCountTypes,
   [in] bool fIncludeNULLType,
   [in] bool fIncludeDuplicates,
   [out] IVsExpansionEnumeration **pEnum
);

The bstrTypes list contains strings that specify the types of snippets to retrieve. These types can be "Expansion" or "SurroundsWith" (see SnippetType Element (IntelliSense Code Snippets) for details on snippet types). It is possible for a code snippet to not have a type associated with it in which case, such snippets are not returned unless the fIncludeNULLType parameter is non-zero (TRUE) or the iCountTypes parameter is 0.

See the Example in the IVsExpansionEnumeration interface topic to see how this method is used to obtain a list of all snippets for a particular coding language.

Show: