次の方法で共有


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
Public methodStatic member Clear Sets the members of the specified span to an empty state.
Public methodStatic member ContainsExclusive Determines whether the given position is contained in the given span, not including the start and end points.
Public methodStatic member ContainsInclusive Determines whether the given position is in the span, including the start and end points.
Public methodStatic member EndsAfterEndOf Determines whether the first span ends after the end of the second span.
Public methodStatic member EndsAfterStartOf Determines whether the first span ends after the start of the second span.
Public methodStatic member EndsBeforeEndOf Determines whether the first span ends before the end of the second span.
Public methodStatic member EndsBeforeStartOf Determines whether the first span ends before the start of the second span.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public methodStatic member Intersects Determines whether the first span intersects the second span.
Public methodStatic member IsAfterEndOf Determines whether the given position occurs after the end of the given span.
Public methodStatic member IsBeforeStartOf Determines whether the given position occurs before the start of the given span.
Public methodStatic member IsEmbedded Determines whether the first span is wholly contained in the second span.
Public methodStatic member IsEmpty Determines whether the given span is empty.
Public methodStatic member IsPositive Determines whether the start of the given span occurs before the end of the span.
Public methodStatic member IsSameSpan Determines whether two spans are the same.
Public methodStatic member MakePositive Makes the given span positive.
Public methodStatic member Merge Merges the two given spans to create a new span.
Public methodStatic member Normalize Pins the ends of the given span to the actual line lengths in the given text buffer.
Public methodStatic member StartsAfterEndOf Determines whether the first span starts after the end of the second span.
Public methodStatic member StartsAfterStartOf Determines whether the first span starts after the start of the second span.
Public methodStatic member StartsBeforeEndOf Determines whether the first span starts before the end of the second span.
Public methodStatic member StartsBeforeStartOf Determines whether the first span starts before the start of the second span.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public methodStatic member ValidCoord Determines whether the given position is valid for the given source buffer.
Public methodStatic member 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.

See Also

Reference

Microsoft.VisualStudio.Package Namespace