CollectionExtensions
Holds extension methods for ICollection<T>.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.ScheduleView.dll
Syntax:
public static class CollectionExtensions
Inheritance: objectCollectionExtensions
Methods
Adds the elements from the specified collection - items to the end of the target list.
public static void AddRange(this IList list, IEnumerable items)
The list that will be extended.
itemsIEnumerableThe items that will be added.
Exceptions:items is null.
Adds the elements from the specified collection - items to the end of the target list.
public static void AddRange(this ItemCollection list, IEnumerable items)
The list that will be extended.
itemsIEnumerableThe items that will be added.
Exceptions:items is null.
Adds the elements from the specified collection - items to the end of the target collection.
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> items)
The collection that will be extended.
itemsIEnumerable<T>The items that will be added.
Exceptions:items is null.
Appends elements from two sequences.
public static IEnumerable<T> Append<T>(this IEnumerable<T> source, IEnumerable<T> other)
The first sequence.
otherIEnumerable<T>The second sequence.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements from both input sequences.
Appends an element to a sequence.
public static IEnumerable<T> Append<T>(this IEnumerable<T> source, T other)
A sequence to return elements from.
otherTAn element to be included in the sequence.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements from the input sequences and appends it with the other element.
Removes all elements from a list that match the condition defined by the specified predicate.
Removes all elements from a collection that match the condition defined by the specified predicate.
public static int RemoveAll<T>(this ICollection<T> collection, Predicate<T> match)
The collection, which elements will be removed.
matchPredicate<T>The predicate delegate that defines the condition for the removed elements.
Returns:Number of removed elements.
Removes all elements from the given collection.
public static void RemoveAll<T>(this IList<T> collection)
The collection, which will be emptied.
Bypasses elements from a sequence as long as a specified condition is true and then returns the remaining elements.
public static IEnumerable<T> TakeAfter<T>(this IEnumerable<T> target, Func<T, bool> predicate)
A sequence to return elements from.
predicateFunc<T, bool>A function to test each element for a condition.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements from the input sequence that occur after the element at which the test no longer passes.
Bypasses elements from a sequence until the specified condition becomes true.
public static IEnumerable<T> TakeBefore<T>(this IEnumerable<T> target, Func<T, bool> predicate)
A sequence to return elements from.
predicateFunc<T, bool>A function to test each element for a condition.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements from the input sequence that occur before the element at which the test no longer passes.
Bypasses elements from a sequence as long as the first condition is false. Returns elements from the remaining elements as long the second condition is false.
public static IEnumerable<T> TakeBetween<T>(this IEnumerable<T> target, Func<T, bool> predicate1, Func<T, bool> predicate2)
A sequence to return elements from.
predicate1Func<T, bool>A function to test each element for a condition.
predicate2Func<T, bool>A function to test each element for a condition.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements from the input sequence that are between the elements that pass the test specified by the predicates.
Returns elements from a sequence as long as they are between the two items.
public static IEnumerable<T> TakeBetween<T>(this IEnumerable<T> target, T item1, T item2)
A sequence to return elements from.
item1TThe first item.
item2TThe second item.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements between the two items including.
Bypasses elements from a sequence as long as a specified condition is false and then returns the element that satisfies the condition and the elements after.
public static IEnumerable<T> TakeFrom<T>(this IEnumerable<T> target, Func<T, bool> predicate)
A sequence to return elements from.
predicateFunc<T, bool>A function to test each element for a condition.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements from the input sequence starting at the last element in the linear series that does not pass the test specified by predicate.
Bypasses elements from a sequence as long as the element is not equal to the items in the sequence.
public static IEnumerable<T> TakeFrom<T>(this IEnumerable<T> target, T item)
A sequence to return elements from.
itemTAn item to test each element.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements from the input sequence starting from the specified item including.
Returns elements from a sequence as long as a specified condition is false. This method also returns the first element that satisfies the condition.
public static IEnumerable<T> TakeTo<T>(this IEnumerable<T> target, Func<T, bool> predicate)
A sequence to return elements from.
predicateFunc<T, bool>A function to test each element for a condition.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements from the input sequence that occur before the element at which the test no longer passes.
Returns elements from a sequence as long as the sequence elements differs from the item.
public static IEnumerable<T> TakeTo<T>(this IEnumerable<T> target, T item)
A sequence to return elements from.
itemTAn item to test each element.
Returns:IEnumerable<T>
An System.Collections.Generic.IEnumerable(T) that contains the elements from the input sequence that occur before the specified item including.
Converts the element to enumerable sequence.
public static IEnumerable<T> ToEnumerable<T>(this T item)
The element to convert to an enumerable sequence.
Returns:IEnumerable<T>
The enumerable sequence containing the elements.