NormalizedSnapshotSpanCollection Class

A read-only collection of SnapshotSpan objects, all from the same snapshot.

Object
  Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection

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

public sealed class NormalizedSnapshotSpanCollection : IList<SnapshotSpan>, 
	ICollection<SnapshotSpan>, IEnumerable<SnapshotSpan>, IList, 
	ICollection, IEnumerable

The NormalizedSnapshotSpanCollection type exposes the following members.

  NameDescription
Public methodNormalizedSnapshotSpanCollection()Initializes an empty NormalizedSnapshotSpanCollection.
Public methodNormalizedSnapshotSpanCollection(SnapshotSpan)Initializes a new instance of a NormalizedSnapshotSpanCollection with a single element.
Public methodNormalizedSnapshotSpanCollection(IEnumerable<SnapshotSpan>)Initializes a new instance of a NormalizedSnapshotSpanCollection from a list of SnapshotSpan objects.
Public methodNormalizedSnapshotSpanCollection(IList<SnapshotSpan>)Initializes a new instance of a NormalizedSnapshotSpanCollection from a list of Span objects.
Public methodNormalizedSnapshotSpanCollection(ITextSnapshot, NormalizedSpanCollection)Initializes a new instance of a NormalizedSnapshotSpanCollection from a NormalizedSpanCollection and a ITextSnapshot.
Public methodNormalizedSnapshotSpanCollection(ITextSnapshot, IEnumerable<Span>)Initializes a new instance of a NormalizedSnapshotSpanCollection from a list of Span objects and a ITextSnapshot.
Public methodNormalizedSnapshotSpanCollection(ITextSnapshot, IList<Span>)Initializes a new instance of a NormalizedSnapshotSpanCollection from a NormalizedSpanCollection and a ITextSnapshot.
Top

  NameDescription
Public propertyCountGets the number of spans in the collection.
Public propertyItemGets the snapshot span at the specified location.
Top

  NameDescription
Public methodContains(Object)Determines whether the collection contains the specified snapshot span.
Public methodContains(SnapshotSpan)Determines whether the collection contains the specified snapshot span.
Public methodCopyTo(Array, Int32)Copies the snapshot spans in this collection to the specified array, starting at the specified index.
Public methodCopyTo(SnapshotSpan[], Int32)Copies the collection to the specified array of snapshot spans at the specified location.
Public methodStatic memberDifferenceCalculates the difference between two normalized snapshot span collections and normalizes the result.
Public methodEqualsDetermines whether two snapshot span collections are the same. (Overrides Object.Equals(Object).)
Public methodGetEnumeratorGets an enumerator for the collection.
Public methodGetHashCodeGets a hash code for the collection. (Overrides Object.GetHashCode.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIndexOf(Object)Gets the index of the specified snapshot span.
Public methodIndexOf(SnapshotSpan)Gets the index of the specified SnapshotSpan.
Public methodStatic memberIntersectionCalculates the intersection of two normalized snapshot span collections and normalizes the result.
Public methodIntersectsWith(NormalizedSnapshotSpanCollection)Determines whether this collection intersects with another normalized snapshot span collection.
Public methodIntersectsWith(SnapshotSpan)Determines whether this collection overlaps with a snapshot span.
Public methodStatic memberOverlapCalculates the overlap of two normalized snapshot span collections and normalizes the result.
Public methodOverlapsWith(NormalizedSnapshotSpanCollection)Determines whether this normalized snapshot span collection overlaps with another collection.
Public methodOverlapsWith(SnapshotSpan)Determines whether this span set overlaps with another span.
Public methodToStringConverts the spans to a string. (Overrides Object.ToString.)
Public methodStatic memberUnionCalculates the union of two snapshot span collections and normalizes the result.
Top

  NameDescription
Public operatorStatic memberEqualityDetermines whether two NormalizedSnapshotSpanCollection objects are the same.
Public operatorStatic memberImplicit(NormalizedSnapshotSpanCollection to NormalizedSpanCollection)Converts the specified NormalizedSnapshotSpanCollection to a NormalizedSpanCollection.
Public operatorStatic memberInequalityDetermines whether two NormalizedSnapshotSpanCollection are different.
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection<SnapshotSpan>.AddAdds a snapshot span to the collection. This method throws a NotSupportedException.
Explicit interface implemetationPrivate methodIList.AddAdds an object to the list. This method throws a NotSupportedException.
Explicit interface implemetationPrivate methodICollection<SnapshotSpan>.ClearClears the collection. This method throws a NotSupportedException.
Explicit interface implemetationPrivate methodIList.ClearClears the list. This method throws a NotSupportedException.
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorGets an enumerator for the collection.
Explicit interface implemetationPrivate methodIList<SnapshotSpan>.InsertInserts a snapshot span into the list. This method throws a NotSupportedException.
Explicit interface implemetationPrivate methodIList.InsertInserts a snapshot span into the list at the specified location. This method throws a NotSupportedException.
Explicit interface implemetationPrivate propertyIList.IsFixedSizeDetermines whether the collection is of fixed size. Always returns true.
Explicit interface implemetationPrivate propertyICollection<SnapshotSpan>.IsReadOnlyDetermines whether the collection is read-only. Always returns true.
Explicit interface implemetationPrivate propertyIList.IsReadOnlyDetermines whether this collection is read-only. This property always returns true.
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedDetermines whether this collection is synchronized.
Explicit interface implemetationPrivate propertyIList.ItemGets the snapshot span at the specified location.
Explicit interface implemetationPrivate methodICollection<SnapshotSpan>.RemoveRemoves the specified span from the collection. This method throws a NotSupportedException.
Explicit interface implemetationPrivate methodIList.RemoveRemoves the specified snapshot span. This method throws a NotSupportedException.
Explicit interface implemetationPrivate methodIList<SnapshotSpan>.RemoveAtRemoves a snapshot span at the specified location. This method throws a NotSupportedException.
Explicit interface implemetationPrivate methodIList.RemoveAtRemoves a snapshot span at the specified location. This method throws a NotSupportedException.
Explicit interface implemetationPrivate propertyICollection.SyncRootGets an object that can be used to synchronized access to this collection.
Top

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.

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:
© 2015 Microsoft