IVsExpansionClient::IsValidKind Method (IVsTextLines^, array<TextSpan>^, String^, Int32)

 

Called to verify that the specified location can accept the specified kind of snippet.

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

int IsValidKind(
	IVsTextLines^ pBuffer,
	array<TextSpan>^ ts,
	String^ bstrKind,
	[OutAttribute] int% pfIsValidKind
)

Parameters

pBuffer
Type: Microsoft.VisualStudio.TextManager.Interop::IVsTextLines^

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

ts
Type: array<Microsoft.VisualStudio.TextManager.Interop::TextSpan>^

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

bstrKind
Type: System::String^

[in] A string that specifies the kind of code snippet that is to be inserted. See Remarks.

pfIsValidKind
Type: System::Int32

[out] Non-zero (TRUE) if the code snippet can be inserted into the specified location based on its kind; 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::IsValidKind(
   [in]IVsTextLines *pBuffer,
   [in]TextSpan *ts,
   [in]BSTR bstrKind
);

The bstrKind parameter is a string that specifies the kinds of snippets to display, such as MethodBody, Page, and File. The snippet kind can control in what context the snippet is inserted. For example, a snippet kind of MethodBody should be inserted only in a method. See for a list of all snippet kinds that are supported. It is possible for a code snippet to not have a kind associated with it in which case the bstrKind parameter is an empty string.6d1301d2-d621-4183-a104-ad5ad559f851

Return to top
Show: