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)
Syntax
'宣告
Public Structure SnapshotSpan
public struct SnapshotSpan
public value class SnapshotSpan
[<Sealed>]
type SnapshotSpan = struct end
JScript supports the use of structures, but not the declaration of new ones.
The SnapshotSpan type exposes the following members.
Constructors
Name | Description | |
---|---|---|
SnapshotSpan(ITextSnapshot, Span) | Initializes a new instance of a SnapshotSpan with the specified snapshot and span. | |
SnapshotSpan(SnapshotPoint, SnapshotPoint) | Initializes a new instance of a SnapshotSpan from two SnapshotPoint objects. | |
SnapshotSpan(SnapshotPoint, Int32) | Initializes a new instance of a SnapshotSpan from an existing SnapshotPoint and a specified length. | |
SnapshotSpan(ITextSnapshot, Int32, Int32) | Initializes a new instance of a SnapshotSpan with the specified snapshot, start point, and length. |
Top
Properties
Name | Description | |
---|---|---|
End | Gets the end of the snapshot span. | |
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. |
Top
Methods
Name | Description | |
---|---|---|
Contains(Int32) | Determines whether the position lies within the span. | |
Contains(SnapshotPoint) | Determines whether the specified SnapshotPoint lies within the span. | |
Contains(SnapshotSpan) | Determines whether the snapshot span falls completely within this span. | |
Contains(Span) | Determines whether the specified span falls completely within this span. | |
Equals | Determines whether two snapshot spans are the same. (Overrides ValueType.Equals(Object).) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for this type. (Overrides ValueType.GetHashCode().) | |
GetText | The text contained by this snapshot span. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Intersection(SnapshotSpan) | Calculates the intersection with the given SnapshotSpan. | |
Intersection(Span) | Calculates the intersection with the given span. | |
IntersectsWith(SnapshotSpan) | Determines whether the specified snapshot span intersects this span. | |
IntersectsWith(Span) | Determines whether the specified span intersects this span. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Overlap(SnapshotSpan) | Gets the overlap with the given SnapshotSpan. | |
Overlap(Span) | Getss the overlap with the given span. | |
OverlapsWith(SnapshotSpan) | Determines whether another span overlaps this span. | |
OverlapsWith(Span) | Determines whether simpleSpan overlaps this span. | |
ToString | Converts this snapshot span to a string. (Overrides ValueType.ToString().) | |
TranslateTo | Translates this snapshot span to a different snapshot of the same ITextBuffer. |
Top
Operators
Name | Description | |
---|---|---|
Equality | Determines whether two snapshot spans are the same. | |
Implicit(SnapshotSpan to Span) | Implicitly converts a snapshot span to a span. | |
Inequality | Determines whether two snapshot spans are different. |
Top
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.