Namespace: | Sirenix.Utilities |
Assembly: | Sirenix.Utilities |
public static class LinqExtensions
public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> range)
System.Collections.Generic.HashSet<T> | hashSet | The hashset. |
System.Collections.Generic.IEnumerable<T> | range | The collection. |
T |
public static void AddRange<T>(this IList<T> list, IEnumerable<T> collection)
System.Collections.Generic.IList<T> | list | |
System.Collections.Generic.IEnumerable<T> | collection |
T |
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, T append)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Boolean | condition | The condition. |
T | append | The item to append. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, IEnumerable<T> append)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Boolean | condition | The condition. |
System.Collections.Generic.IEnumerable<T> | append | The collection to append. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, Func<T> append)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Boolean | condition | The condition. |
System.Func<T> | append | Func to create the item to append. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, T append)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<System.Boolean> | condition | The condition. |
T | append | The item to append. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, IEnumerable<T> append)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<System.Boolean> | condition | The condition. |
System.Collections.Generic.IEnumerable<T> | append | The collection to append. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, Func<T> append)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<System.Boolean> | condition | The condition. |
System.Func<T> | append | Func to create the item to append. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, T append)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
T | append | The item to append. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, IEnumerable<T> append)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Collections.Generic.IEnumerable<T> | append | The collection to append. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, Func<T> append)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<T> | append | Func to create the item to append. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> Convert<T>(this IEnumerable source, Func<object, T> converter)
System.Collections.IEnumerable | source | The collection. |
System.Func<System.Object, T> | converter | Func to convert the items. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> Examine<T>(this IEnumerable<T> source, Action<T> action)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Action<T> | action | The action to call for each item. |
System.Collections.Generic.IEnumerable<T> |
T |
T
.
public static IEnumerable<T> FilterCast<T>(this IEnumerable source)
System.Collections.IEnumerable | source | The collection. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T, int> action)
System.Collections.Generic.IEnumerable<T> | source | The source. |
System.Action<T, System.Int32> | action | The action to perform. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T> action)
System.Collections.Generic.IEnumerable<T> | source | The source. |
System.Action<T> | action | The action to perform. |
System.Collections.Generic.IEnumerable<T> |
T |
true
if the list is either null or empty. Otherwise false
.
public static bool IsNullOrEmpty<T>(this IList<T> list)
System.Collections.Generic.IList<T> | list | The list. |
System.Boolean |
T |
public static void Populate<T>(this IList<T> list, T item)
System.Collections.Generic.IList<T> | list | The list. |
T | item | The value. |
T |
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, T prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Boolean | condition | The condition. |
T | prepend | The item to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, IEnumerable<T> prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Boolean | condition | The condition. |
System.Collections.Generic.IEnumerable<T> | prepend | The collection to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, Func<T> prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Boolean | condition | The condition. |
System.Func<T> | prepend | Func to create the item to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, T prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<System.Boolean> | condition | The condition. |
T | prepend | The item to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, IEnumerable<T> prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<System.Boolean> | condition | The condition. |
System.Collections.Generic.IEnumerable<T> | prepend | The collection to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, Func<T> prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<System.Boolean> | condition | The condition. |
System.Func<T> | prepend | Func to create the item to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, T prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<System.Collections.Generic.IEnumerable<T>, System.Boolean> | condition | The condition. |
T | prepend | The item to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, IEnumerable<T> prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<System.Collections.Generic.IEnumerable<T>, System.Boolean> | condition | The condition. |
System.Collections.Generic.IEnumerable<T> | prepend | The collection to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, Func<T> prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<System.Collections.Generic.IEnumerable<T>, System.Boolean> | condition | The condition. |
System.Func<T> | prepend | Func to create the item to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependWith<T>(this IEnumerable<T> source, T prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
T | prepend | The item to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependWith<T>(this IEnumerable<T> source, IEnumerable<T> prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Collections.Generic.IEnumerable<T> | prepend | The collection to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static IEnumerable<T> PrependWith<T>(this IEnumerable<T> source, Func<T> prepend)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
System.Func<T> | prepend | Func to create the item to prepend. |
System.Collections.Generic.IEnumerable<T> |
T |
public static void Sort<T>(this IList<T> list)
System.Collections.Generic.IList<T> | list |
T |
public static void Sort<T>(this IList<T> list, Comparison<T> comparison)
System.Collections.Generic.IList<T> | list | |
System.Comparison<T> | comparison |
T |
public static ImmutableList<T> ToImmutableList<T>(this IEnumerable<T> source)
System.Collections.Generic.IEnumerable<T> | source | The collection. |
ImmutableList<T> |
T |