SnapshotSpan Structure

An immutable text span in a particular text snapshot.

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

public struct SnapshotSpan

The SnapshotSpan type exposes the following members.

  NameDescription
Public methodSnapshotSpan(ITextSnapshot, Span)Initializes a new instance of a SnapshotSpan with the specified snapshot and span.
Public methodSnapshotSpan(SnapshotPoint, SnapshotPoint)Initializes a new instance of a SnapshotSpan from two SnapshotPoint objects.
Public methodSnapshotSpan(SnapshotPoint, Int32)Initializes a new instance of a SnapshotSpan from an existing SnapshotPoint and a specified length.
Public methodSnapshotSpan(ITextSnapshot, Int32, Int32)Initializes a new instance of a SnapshotSpan with the specified snapshot, start point, and length.
Top

  NameDescription
Public propertyEndGets the end of the snapshot span.
Public propertyIsEmptyDetermines whether or not this span is empty.
Public propertyLengthGets the length of the span, which is always non-negative.
Public propertySnapshotThe ITextSnapshot to which this snapshot span refers.
Public propertySpanGets the span covered by the snapshot span.
Public propertyStartGets the starting index of the snapshot span.
Top

  NameDescription
Public methodContains(Int32)Determines whether the position lies within the span.
Public methodContains(SnapshotPoint)Determines whether the specified SnapshotPoint lies within the span.
Public methodContains(SnapshotSpan)Determines whether the snapshot span falls completely within this span.
Public methodContains(Span)Determines whether the specified span falls completely within this span.
Public methodEqualsDetermines whether two snapshot spans are the same. (Overrides ValueType.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for this type. (Overrides ValueType.GetHashCode().)
Public methodGetTextThe text contained by this snapshot span.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIntersection(SnapshotSpan)Calculates the intersection with the given SnapshotSpan.
Public methodIntersection(Span)Calculates the intersection with the given span.
Public methodIntersectsWith(SnapshotSpan)Determines whether the specified snapshot span intersects this span.
Public methodIntersectsWith(Span)Determines whether the specified span intersects this span.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodOverlap(SnapshotSpan)Gets the overlap with the given SnapshotSpan.
Public methodOverlap(Span)Getss the overlap with the given span.
Public methodOverlapsWith(SnapshotSpan)Determines whether another span overlaps this span.
Public methodOverlapsWith(Span)Determines whether simpleSpan overlaps this span.
Public methodToStringConverts this snapshot span to a string. (Overrides ValueType.ToString().)
Public methodTranslateToTranslates this snapshot span to a different snapshot of the same ITextBuffer.
Top

  NameDescription
Public operatorStatic memberEqualityDetermines whether two snapshot spans are the same.
Public operatorStatic memberImplicit(SnapshotSpan to Span)Implicitly converts a snapshot span to a span.
Public operatorStatic memberInequalityDetermines whether two snapshot spans are different.
Top

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

Community Additions

ADD
Show:
© 2015 Microsoft