Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Class: RT.KitchenSink.Collections.LazyList<T>

Summary

Exposes an IEnumerable<T> as an IList<T>, enabling buffering of and indexing into the elements generated by the enumerable, while still ensuring that the enumerable is enumerated in a lazy fashion, only as required, and at most once. This collection is read-only, and all write-related methods throw a NotSupportedException.

Generic type parameters

TType of the elements in the enumeration.

Constructors

LazyList<T>(IEnumerable<T> enumerable)
Constructor.

Instance methods

bool
Contains(T item)
  • Implements: ICollection<T>.Contains(T)
Determines whether an element is in the list.
void
CopyTo(T[] array, int arrayIndex)
  • Implements: ICollection<T>.CopyTo(T[], int)
Copies all elements to the specified array starting at the specified index.
void
  • Implements: IDisposable.Dispose()
Disposes of the enumerable's enumerator, if one is held at the moment.
IEnumerator<T>
  • Implements: IEnumerable<T>.GetEnumerator()
Returns an enumerator for the collection. Warning: This enumerates the underlying collection completely before returning.
bool
IndexInRange(int index)
Checks whether the specified index is a valid index, i.e. not out-of-range.
int
IndexOf(T item)
  • Implements: IList<T>.IndexOf(T)
Returns the index of the specified item, or -1 if the item is not found. (see also remarks)

Instance properties

int
  • Implements: ICollection<T>.Count
Gets the number of elements. Note that this method will have to enumerate the underlying enumerable in full.
bool Returns true.
T
this[int index]
Gets the item at the specified index.