TextSpanHelper.Intersects Method
Determines whether the first span intersects the second span.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Syntax
'Declaration
Public Shared Function Intersects ( _
span1 As TextSpan, _
span2 As TextSpan _
) As Boolean
public static bool Intersects(
TextSpan span1,
TextSpan span2
)
public:
static bool Intersects(
TextSpan span1,
TextSpan span2
)
static member Intersects :
span1:TextSpan *
span2:TextSpan -> bool
public static function Intersects(
span1 : TextSpan,
span2 : TextSpan
) : boolean
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.
Remarks
This method returns true if calls to the StartsBeforeEndOf and EndsAfterStartOf methods both return true.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.