Share via


TextSpanHelper.ValidSpan Method

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

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 ValidSpan ( _
    src As Source, _
    span As TextSpan _
) As Boolean
public static bool ValidSpan(
    Source src,
    TextSpan span
)
public:
static bool ValidSpan(
    Source^ src, 
    TextSpan span
)
static member ValidSpan : 
        src:Source * 
        span:TextSpan -> bool
public static function ValidSpan(
    src : Source, 
    span : TextSpan
) : boolean

Parameters

Return Value

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

Remarks

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.

.NET Framework Security

See Also

Reference

TextSpanHelper Class

Microsoft.VisualStudio.Package Namespace