SnapshotSpan Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An immutable text span in a particular text snapshot.
public value class SnapshotSpan
struct SnapshotSpan
public struct SnapshotSpan
type SnapshotSpan = struct
Public Structure SnapshotSpan
- Inheritance
-
SnapshotSpan
Constructors
SnapshotSpan(ITextSnapshot, Int32, Int32) |
Initializes a new instance of a SnapshotSpan with the specified snapshot, start point, and length. |
SnapshotSpan(ITextSnapshot, Span) |
Initializes a new instance of a SnapshotSpan with the specified snapshot and span. |
SnapshotSpan(SnapshotPoint, Int32) |
Initializes a new instance of a SnapshotSpan from an existing SnapshotPoint and a specified length. |
SnapshotSpan(SnapshotPoint, SnapshotPoint) |
Initializes a new instance of a SnapshotSpan from two SnapshotPoint objects. |
Properties
End |
Gets the end of the snapshot span. The span is open-ended on the right side, which is to say that Start + Length = End. |
IsEmpty |
Determines whether or not this span is empty. |
Length |
Gets the length of the span, which is always non-negative. |
Snapshot |
The ITextSnapshot to which this snapshot span refers. |
Span |
Gets the span covered by the snapshot span. |
Start |
Gets the starting index of the snapshot span. |
Methods
Contains(Int32) |
Determines whether the position lies within the span. |
Contains(SnapshotPoint) |
Determines whether a given SnapshotPoint lies within the span. |
Contains(SnapshotSpan) |
Determines whether |
Contains(Span) |
Determines whether |
Equals(Object) |
Determines whether two snapshot spans are the same. |
GetHashCode() |
Serves as a hash function for this type. |
GetText() |
The text contained by this snapshot span. |
Intersection(SnapshotSpan) |
Computes the intersection with the given SnapshotSpan, or null if there is no intersection. |
Intersection(Span) |
Computes the intersection with the given span, or null if there is no intersection. |
IntersectsWith(SnapshotSpan) |
Determines whether |
IntersectsWith(Span) |
Determines whether |
Overlap(SnapshotSpan) |
Returns the overlap with the given SnapshotSpan, or null if there is no overlap. |
Overlap(Span) |
Returns the overlap with the given span, or null if there is no overlap. |
OverlapsWith(SnapshotSpan) |
Determines whether |
OverlapsWith(Span) |
Determines whether |
ToString() |
Converts this snapshot span to a string, or to the string "uninit" if the ITextSnapshot is null. |
TranslateTo(ITextSnapshot, SpanTrackingMode) |
Translates this snapshot span to a different snapshot of the same ITextBuffer. |
Operators
Equality(SnapshotSpan, SnapshotSpan) |
Determines whether two snapshot spans are the same. |
Implicit(SnapshotSpan to Span) |
Implicitly converts a snapshot span to a span. |
Inequality(SnapshotSpan, SnapshotSpan) |
Determines whether two snapshot spans are different. |