NormalizedSnapshotSpanCollection Class
A read-only collection of SnapshotSpan objects, all from the same snapshot.
Inheritance Hierarchy
Object
Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection
Namespace: Microsoft.VisualStudio.Text
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
'Declaration
Public NotInheritable Class NormalizedSnapshotSpanCollection _
Implements IList(Of SnapshotSpan), ICollection(Of SnapshotSpan), _
IEnumerable(Of SnapshotSpan), IList, ICollection, IEnumerable
public sealed class NormalizedSnapshotSpanCollection : IList<SnapshotSpan>,
ICollection<SnapshotSpan>, IEnumerable<SnapshotSpan>, IList,
ICollection, IEnumerable
public ref class NormalizedSnapshotSpanCollection sealed : IList<SnapshotSpan>,
ICollection<SnapshotSpan>, IEnumerable<SnapshotSpan>, IList,
ICollection, IEnumerable
[<Sealed>]
type NormalizedSnapshotSpanCollection =
class
interface IList<SnapshotSpan>
interface ICollection<SnapshotSpan>
interface IEnumerable<SnapshotSpan>
interface IList
interface ICollection
interface IEnumerable
end
public final class NormalizedSnapshotSpanCollection implements IList<SnapshotSpan>, ICollection<SnapshotSpan>, IEnumerable<SnapshotSpan>, IList, ICollection, IEnumerable
The NormalizedSnapshotSpanCollection type exposes the following members.
Constructors
Name | Description | |
---|---|---|
NormalizedSnapshotSpanCollection() | Initializes an empty NormalizedSnapshotSpanCollection. | |
NormalizedSnapshotSpanCollection(SnapshotSpan) | Initializes a new instance of a NormalizedSnapshotSpanCollection with a single element. | |
NormalizedSnapshotSpanCollection(IEnumerable<SnapshotSpan>) | Initializes a new instance of a NormalizedSnapshotSpanCollection from a list of SnapshotSpan objects. | |
NormalizedSnapshotSpanCollection(IList<SnapshotSpan>) | Initializes a new instance of a NormalizedSnapshotSpanCollection from a list of Span objects. | |
NormalizedSnapshotSpanCollection(ITextSnapshot, NormalizedSpanCollection) | Initializes a new instance of a NormalizedSnapshotSpanCollection from a NormalizedSpanCollection and a ITextSnapshot. | |
NormalizedSnapshotSpanCollection(ITextSnapshot, IEnumerable<Span>) | Initializes a new instance of a NormalizedSnapshotSpanCollection from a list of Span objects and a ITextSnapshot. | |
NormalizedSnapshotSpanCollection(ITextSnapshot, IList<Span>) | Initializes a new instance of a NormalizedSnapshotSpanCollection from a NormalizedSpanCollection and a ITextSnapshot. |
Top
Properties
Name | Description | |
---|---|---|
Count | Gets the number of spans in the collection. | |
Item | Gets the snapshot span at the specified location. |
Top
Methods
Name | Description | |
---|---|---|
Contains(Object) | Determines whether the collection contains the specified snapshot span. | |
Contains(SnapshotSpan) | Determines whether the collection contains the specified snapshot span. | |
CopyTo(Array, Int32) | Copies the snapshot spans in this collection to the specified array, starting at the specified index. | |
CopyTo(array<SnapshotSpan[], Int32) | Copies the collection to the specified array of snapshot spans at the specified location. | |
Difference | Calculates the difference between two normalized snapshot span collections and normalizes the result. | |
Equals | Determines whether two snapshot span collections are the same. (Overrides Object.Equals(Object).) | |
GetEnumerator | Gets an enumerator for the collection. | |
GetHashCode | Gets a hash code for the collection. (Overrides Object.GetHashCode.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IndexOf(Object) | Gets the index of the specified snapshot span. | |
IndexOf(SnapshotSpan) | Gets the index of the specified SnapshotSpan. | |
Intersection | Calculates the intersection of two normalized snapshot span collections and normalizes the result. | |
IntersectsWith(NormalizedSnapshotSpanCollection) | Determines whether this collection intersects with another normalized snapshot span collection. | |
IntersectsWith(SnapshotSpan) | Determines whether this collection overlaps with a snapshot span. | |
Overlap | Calculates the overlap of two normalized snapshot span collections and normalizes the result. | |
OverlapsWith(NormalizedSnapshotSpanCollection) | Determines whether this normalized snapshot span collection overlaps with another collection. | |
OverlapsWith(SnapshotSpan) | Determines whether this span set overlaps with another span. | |
ToString | Converts the spans to a string. (Overrides Object.ToString.) | |
Union | Calculates the union of two snapshot span collections and normalizes the result. |
Top
Operators
Name | Description | |
---|---|---|
Equality | Determines whether two NormalizedSnapshotSpanCollection objects are the same. | |
Implicit(NormalizedSnapshotSpanCollection to NormalizedSpanCollection) | Converts the specified NormalizedSnapshotSpanCollection to a NormalizedSpanCollection. | |
Inequality | Determines whether two NormalizedSnapshotSpanCollection are different. |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
ICollection<SnapshotSpan>.Add | Adds a snapshot span to the collection. This method throws a NotSupportedException. | |
IList.Add | Adds an object to the list. This method throws a NotSupportedException. | |
ICollection<SnapshotSpan>.Clear | Clears the collection. This method throws a NotSupportedException. | |
IList.Clear | Clears the list. This method throws a NotSupportedException. | |
IEnumerable.GetEnumerator | Gets an enumerator for the collection. | |
IList<SnapshotSpan>.Insert | Inserts a snapshot span into the list. This method throws a NotSupportedException. | |
IList.Insert | Inserts a snapshot span into the list at the specified location. This method throws a NotSupportedException. | |
IList.IsFixedSize | Determines whether the collection is of fixed size. Always returns true. | |
ICollection<SnapshotSpan>.IsReadOnly | Determines whether the collection is read-only. Always returns true. | |
IList.IsReadOnly | Determines whether this collection is read-only. This property always returns true. | |
ICollection.IsSynchronized | Determines whether this collection is synchronized. | |
IList.Item | Gets the snapshot span at the specified location. | |
ICollection<SnapshotSpan>.Remove | Removes the specified span from the collection. This method throws a NotSupportedException. | |
IList.Remove | Removes the specified snapshot span. This method throws a NotSupportedException. | |
IList<SnapshotSpan>.RemoveAt | Removes a snapshot span at the specified location. This method throws a NotSupportedException. | |
IList.RemoveAt | Removes a snapshot span at the specified location. This method throws a NotSupportedException. | |
ICollection.SyncRoot | Gets an object that can be used to synchronized access to this collection. |
Top
Remarks
For more information about snapshots, see the section "A Closer Look at the Text Model and the Text View" in Inside the Editor.
The snapshot spans are sorted by start position. Adjacent and overlapping spans are combined.
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.