TextSpanHelper.ValidSpan Method
Determines whether the given span lies within the given source buffer.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.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)
Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.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
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: 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
- 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.