IVsExpansionClient.IsValidType Method (IVsTextLines, TextSpan[], String[], Int32, Int32)


Called to verify that the specified location can accept the specified types of code snippets.

Namespace:   Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

int IsValidType(
	IVsTextLines pBuffer,
	TextSpan[] ts,
	string[] rgTypes,
	int iCountTypes,
	out int pfIsValidType


Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextLines

[in] An IVsTextLines object that represents the text buffer where the code snippet is to be inserted.

Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan[]

[in] A TextSpan object that describes the location where the code snippet is to be inserted.

Type: System.String[]

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

Type: System.Int32

[in] The number of types specified in the rgTypes array.

Type: System.Int32

[out] Non-zero (TRUE) if the code snippet can be inserted into the specified location based on its types; zero (FALSE) if the code snippet cannot be inserted.

Return Value

Type: System.Int32

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

From textmgr2.idl:

bool IVsExpansionClient::IsValidType(
   [in]IVsTextLines *pBuffer,
   [in]TextSpan *ts,
   [in, size_is(iCountTypes)]BSTR* rgTypes,
   [in] int iCountTypes

The rgTypes list contains strings that specify the types of snippets to display. These types can be "Expansion" or "SurroundsWith" (see for details on snippet types). It is possible for a code snippet to not have a type associated with it, in which case the iCountTypes parameter is 0.1a7a93ab-1af1-4f38-babf-a9aa5315b45c

Return to top