Span Structure

Represents a range.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

public struct Span

The Span type exposes the following members.

  NameDescription
Public methodSpanInitializes a new instance of a Span with the given start point and length.
Top

  NameDescription
Public propertyEndGets the end of the span.
Public propertyIsEmptyDetermines whether or not this span is empty.
Public propertyLengthGets the length of the span, which is always non-negative.
Public propertyStartGets the starting index of the span.
Top

  NameDescription
Public methodContains(Int32)Determines whether the position lies within the span.
Public methodContains(Span)Determines whether the specified span falls completely within this span.
Public methodEqualsDetermines whether two spans are the same. (Overrides ValueType.Equals(Object).)
Public methodStatic memberFromBoundsInitializes a new instance of a Span with the given start and end positions.
Public methodGetHashCodeProvides a hash function for the type. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIntersectionGets the intersection with the given span, or null if there is no intersection.
Public methodIntersectsWithDetermines whether span intersects this span.
Public methodOverlapGets the overlap with the specified span.
Public methodOverlapsWithDetermines whether the specified span overlaps this span.
Public methodToStringProvides a string representation of the span. (Overrides ValueType.ToString().)
Top

  NameDescription
Public operatorStatic memberEqualityDetermines whether two spans are the same.
Public operatorStatic memberInequalityDetermines whether two spans are different.
Top

This structure represents an immutable integer interval that describes a range of values, from Start to End. It is closed on the left and open on the right: [Start .. End). In the context of an ITextSnapshot it represents a span of text, but the span structure itself is independent of any particular text buffer or snapshot.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft