Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

CollectionExtensions

Mark Smith edited this page Aug 29, 2016 · 1 revision

CollectionExtensions

This is a set of extension methods on top of IList, IEnumerable and ICollection types.

Methods

  • ToGroupedObservable - takes a GroupBy result and turns it into a GroupedObservableCollection<TKey,TValue>.
  • ToObservableCollection - takes an IEnumerable set and returns an ObservableCollection<T>.
  • BubbleSort - sorts an IList<T> using the Bubble Sort algorithm. Two variations are supplied - one takes an IComparer and the other takes a Func<T,T,int> to do the comparison.
  • Compare - compares two collections and returns whether they have the same set included with (optionally) the same ordering.
  • AddRange - adds a range of IEnumerable items to a ICollection.
  • RemoveRange - removes a range of IEnumerable items to a ICollection.
  • IndexOf - returns the index position of a given item in an IEnumerable using a Predicate<T> as the test.
  • Swap - swaps two values in an IList<T> based on index.
  • MoveRange - moves a section of a IList<T> from one position in the list to another, supports overlapping regions.