ExpansionProvider.IsValidKind Method (IVsTextLines, TextSpan[], String, Int32)


Determines whether this is valid text for expansion. This method should be overridden if you want to specify where in the source document the expansion can take place.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public virtual int IsValidKind(
	IVsTextLines buffer,
	TextSpan[] ts,
	string bstrKind,
	out int fIsValid


Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextLines

The IVsTextLines buffer.

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

An array of TextSpan objects.

Type: System.String

The kind of expansion to perform.

Type: System.Int32

[out] Returns true if it is a valid expansion kind, otherwise false.

Return Value

Type: System.Int32

When overridden in derived classes, S_OK if the method succeeds, otherwise an error code.

This method by default checks only that buffer is the same as the IVsTextLines of Source; it will throw an ArgumentException if not. Implementers must override this method if they wish to specify where in a document a given expansion can be performed.

Return to top