TextSpanHelper Class

Definition

Important

This API is not CLS-compliant.

A utility class that provides methods for manipulating and comparing instances of the TextSpan class, and also for validating positions.

public ref class TextSpanHelper sealed
public ref class TextSpanHelper sealed
class TextSpanHelper sealed
[System.CLSCompliant(false)]
public sealed class TextSpanHelper
public sealed class TextSpanHelper
[<System.CLSCompliant(false)>]
type TextSpanHelper = class
type TextSpanHelper = class
Public NotInheritable Class TextSpanHelper
Inheritance
TextSpanHelper
Attributes

Remarks

Manipulation includes clearing, normalizing, merging, and converting to and from a <xref:Microsoft.VisualStudio.TextManager.Interop.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 Inheritors

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.

Methods

Clear(TextSpan)

Sets the members of the specified span to an empty state.

ContainsExclusive(TextSpan, Int32, Int32)

Determines whether the given position is contained in the given span, not including the start and end points.

ContainsInclusive(TextSpan, Int32, Int32)

Determines whether the given position is in the span, including the start and end points.

EndsAfterEndOf(TextSpan, TextSpan)

Determines whether the first span ends after the end of the second span.

EndsAfterStartOf(TextSpan, TextSpan)

Determines whether the first span ends after the start of the second span.

EndsBeforeEndOf(TextSpan, TextSpan)

Determines whether the first span ends before the end of the second span.

EndsBeforeStartOf(TextSpan, TextSpan)

Determines whether the first span ends before the start of the second span.

Intersects(TextSpan, TextSpan)

Determines whether the first span intersects the second span.

IsAfterEndOf(TextSpan, Int32, Int32)

Determines whether the given position occurs after the end of the given span.

IsBeforeStartOf(TextSpan, Int32, Int32)

Determines whether the given position occurs before the start of the given span.

IsEmbedded(TextSpan, TextSpan)

Determines whether the first span is wholly contained in the second span.

IsEmpty(TextSpan)

Determines whether the given span is empty.

IsPositive(TextSpan)

Determines whether the start of the given span occurs before the end of the span.

IsSameSpan(TextSpan, TextSpan)

Determines whether two spans are the same.

MakePositive(TextSpan)

Makes the given span positive.

Merge(TextSpan, TextSpan)

Merges the two given spans to create a new span.

Normalize(TextSpan, IVsTextLines)

Pins the ends of the given span to the actual line lengths in the given text buffer.

StartsAfterEndOf(TextSpan, TextSpan)

Determines whether the first span starts after the end of the second span.

StartsAfterStartOf(TextSpan, TextSpan)

Determines whether the first span starts after the start of the second span.

StartsBeforeEndOf(TextSpan, TextSpan)

Determines whether the first span starts before the end of the second span.

StartsBeforeStartOf(TextSpan, TextSpan)

Determines whether the first span starts before the start of the second span.

ValidCoord(Source, Int32, Int32)

Determines whether the given position is valid for the given source buffer.

ValidSpan(Source, TextSpan)

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

Applies to