TextSpanHelper::Intersects Method (TextSpan, TextSpan)

 

Determines whether the first span intersects the second span.

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

public:
static bool Intersects(
	TextSpan span1,
	TextSpan span2
)

Parameters

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

[in] The first TextSpan object.

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

[in] The second TextSpan object.

Return Value

Type: System::Boolean

Returns true if the start of span1 is less than the end of span2 and the end of span1 is greater than the start of span2; otherwise, returns false. Notice that the spans do not intersect if one span ends exactly where the other begins.

This method returns true if calls to the StartsBeforeEndOf and EndsAfterStartOf methods both return true.

Return to top
Show: