TextSpanHelper Class
A utility class that provides methods for manipulating and comparing instances of the TextSpan class, and also for validating positions.
This API is not CLS-compliant.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.Package.TextSpanHelper
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
‘선언
<CLSCompliantAttribute(False)> _
Public NotInheritable Class TextSpanHelper
[CLSCompliantAttribute(false)]
public sealed class TextSpanHelper
The TextSpanHelper type exposes the following members.
Methods
Name | Description | |
---|---|---|
Clear | Sets the members of the specified span to an empty state. | |
ContainsExclusive | Determines whether the given position is contained in the given span, not including the start and end points. | |
ContainsInclusive | Determines whether the given position is in the span, including the start and end points. | |
EndsAfterEndOf | Determines whether the first span ends after the end of the second span. | |
EndsAfterStartOf | Determines whether the first span ends after the start of the second span. | |
EndsBeforeEndOf | Determines whether the first span ends before the end of the second span. | |
EndsBeforeStartOf | Determines whether the first span ends before the start of the second span. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Intersects | Determines whether the first span intersects the second span. | |
IsAfterEndOf | Determines whether the given position occurs after the end of the given span. | |
IsBeforeStartOf | Determines whether the given position occurs before the start of the given span. | |
IsEmbedded | Determines whether the first span is wholly contained in the second span. | |
IsEmpty | Determines whether the given span is empty. | |
IsPositive | Determines whether the start of the given span occurs before the end of the span. | |
IsSameSpan | Determines whether two spans are the same. | |
MakePositive | Makes the given span positive. | |
Merge | Merges the two given spans to create a new span. | |
Normalize | Pins the ends of the given span to the actual line lengths in the given text buffer. | |
StartsAfterEndOf | Determines whether the first span starts after the end of the second span. | |
StartsAfterStartOf | Determines whether the first span starts after the start of the second span. | |
StartsBeforeEndOf | Determines whether the first span starts before the end of the second span. | |
StartsBeforeStartOf | Determines whether the first span starts before the start of the second span. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
ValidCoord | Determines whether the given position is valid for the given source buffer. | |
ValidSpan | Determines whether the given span lies within the given source buffer. |
Top
Remarks
Manipulation includes clearing, normalizing, merging, and converting to and from a TextSpan2 class. Comparisons include determining the relationship of a point to a span and the relationship of two spans. Validation is done for a position or a span in a source buffer.
Notes to Implementers
All methods in this class are static and there is nothing from which to inherit.
Notes to Callers
All methods in this class are static and can be called at any time.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.