TextSpanHelper::ValidSpan Method (Source^, TextSpan)

 

Determines whether the given span lies within the given source buffer.

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

public:
static bool ValidSpan(
	Source^ src,
	TextSpan span
)

Parameters

src
Type: Microsoft.VisualStudio.Package::Source^

[in] A Source object to validate against.

span
Type: Microsoft.VisualStudio.TextManager.Interop::TextSpan

[in] The TextSpan object representing the span to test.

Return Value

Type: System::Boolean

Returns true if the span lies entirely within the source buffer and is positive; otherwise, returns false.

The start and end points of the span are passed to the ValidCoord method and if both points test valid, the span is then tested to make sure it is positive. If that test is also true, then this method returns true.

Return to top
Show: