Version 3.0.1.0

LinqExtensions class

Namespace: Sirenix.Utilities
Assembly: Sirenix.Utilities
public static class LinqExtensions
Inheritance
  • System.Object
  • LinqExtensions

Methods

AddRange<T>(HashSet<T>, IEnumerable<T>)
public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> range)
Parameters
System.Collections.Generic.HashSet<T> hashSet

System.Collections.Generic.IEnumerable<T> range

Type Parameters
T

AddRange<T>(IList<T>, IEnumerable<T>)
public static void AddRange<T>(this IList<T> list, IEnumerable<T> collection)
Parameters
System.Collections.Generic.IList<T> list

System.Collections.Generic.IEnumerable<T> collection

Type Parameters
T

AppendIf<T>(IEnumerable<T>, Boolean, T)
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, T append)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Boolean condition

T append

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

AppendIf<T>(IEnumerable<T>, Boolean, IEnumerable<T>)
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, IEnumerable<T> append)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Boolean condition

System.Collections.Generic.IEnumerable<T> append

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

AppendIf<T>(IEnumerable<T>, Boolean, Func<T>)
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, Func<T> append)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Boolean condition

System.Func<T> append

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

AppendIf<T>(IEnumerable<T>, Func<Boolean>, T)
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, T append)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<System.Boolean> condition

T append

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

AppendIf<T>(IEnumerable<T>, Func<Boolean>, IEnumerable<T>)
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, IEnumerable<T> append)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<System.Boolean> condition

System.Collections.Generic.IEnumerable<T> append

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

AppendIf<T>(IEnumerable<T>, Func<Boolean>, Func<T>)
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, Func<T> append)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<System.Boolean> condition

System.Func<T> append

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

AppendWith<T>(IEnumerable<T>, T)
public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, T append)
Parameters
System.Collections.Generic.IEnumerable<T> source

T append

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

AppendWith<T>(IEnumerable<T>, IEnumerable<T>)
public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, IEnumerable<T> append)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Collections.Generic.IEnumerable<T> append

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

AppendWith<T>(IEnumerable<T>, Func<T>)
public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, Func<T> append)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<T> append

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

Convert<T>(IEnumerable, Func<Object, T>)
public static IEnumerable<T> Convert<T>(this IEnumerable source, Func<object, T> converter)
Parameters
System.Collections.IEnumerable source

System.Func<System.Object, T> converter

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

Examine<T>(IEnumerable<T>, Action<T>)
public static IEnumerable<T> Examine<T>(this IEnumerable<T> source, Action<T> action)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Action<T> action

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

FilterCast<T>(IEnumerable)
public static IEnumerable<T> FilterCast<T>(this IEnumerable source)
Parameters
System.Collections.IEnumerable source

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

ForEach<T>(IEnumerable<T>, Action<T, Int32>)
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T, int> action)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Action<T, System.Int32> action

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

ForEach<T>(IEnumerable<T>, Action<T>)
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T> action)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Action<T> action

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

IsNullOrEmpty<T>(IList<T>)
public static bool IsNullOrEmpty<T>(this IList<T> list)
Parameters
System.Collections.Generic.IList<T> list

Returns
System.Boolean

Type Parameters
T

Populate<T>(IList<T>, T)
public static void Populate<T>(this IList<T> list, T item)
Parameters
System.Collections.Generic.IList<T> list

T item

Type Parameters
T

PrependIf<T>(IEnumerable<T>, Boolean, T)
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, T prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Boolean condition

T prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependIf<T>(IEnumerable<T>, Boolean, IEnumerable<T>)
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, IEnumerable<T> prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Boolean condition

System.Collections.Generic.IEnumerable<T> prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependIf<T>(IEnumerable<T>, Boolean, Func<T>)
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, Func<T> prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Boolean condition

System.Func<T> prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependIf<T>(IEnumerable<T>, Func<Boolean>, T)
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, T prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<System.Boolean> condition

T prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependIf<T>(IEnumerable<T>, Func<Boolean>, IEnumerable<T>)
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, IEnumerable<T> prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<System.Boolean> condition

System.Collections.Generic.IEnumerable<T> prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependIf<T>(IEnumerable<T>, Func<Boolean>, Func<T>)
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, Func<T> prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<System.Boolean> condition

System.Func<T> prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependIf<T>(IEnumerable<T>, Func<IEnumerable<T>, Boolean>, T)
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, T prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<System.Collections.Generic.IEnumerable<T>, System.Boolean> condition

T prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependIf<T>(IEnumerable<T>, Func<IEnumerable<T>, Boolean>, IEnumerable<T>)
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, IEnumerable<T> prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<System.Collections.Generic.IEnumerable<T>, System.Boolean> condition

System.Collections.Generic.IEnumerable<T> prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependIf<T>(IEnumerable<T>, Func<IEnumerable<T>, Boolean>, Func<T>)
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, Func<T> prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<System.Collections.Generic.IEnumerable<T>, System.Boolean> condition

System.Func<T> prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependWith<T>(IEnumerable<T>, T)
public static IEnumerable<T> PrependWith<T>(this IEnumerable<T> source, T prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

T prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependWith<T>(IEnumerable<T>, IEnumerable<T>)
public static IEnumerable<T> PrependWith<T>(this IEnumerable<T> source, IEnumerable<T> prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Collections.Generic.IEnumerable<T> prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

PrependWith<T>(IEnumerable<T>, Func<T>)
public static IEnumerable<T> PrependWith<T>(this IEnumerable<T> source, Func<T> prepend)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Func<T> prepend

Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

Sort<T>(IList<T>)
public static void Sort<T>(this IList<T> list)
Parameters
System.Collections.Generic.IList<T> list

Type Parameters
T

Sort<T>(IList<T>, Comparison<T>)
public static void Sort<T>(this IList<T> list, Comparison<T> comparison)
Parameters
System.Collections.Generic.IList<T> list

System.Comparison<T> comparison

Type Parameters
T

ToHashSet<T>(IEnumerable<T>)
public static HashSet<T> ToHashSet<T>(this IEnumerable<T> source)
Parameters
System.Collections.Generic.IEnumerable<T> source

Returns
System.Collections.Generic.HashSet<T>

Type Parameters
T

ToHashSet<T>(IEnumerable<T>, IEqualityComparer<T>)
public static HashSet<T> ToHashSet<T>(this IEnumerable<T> source, IEqualityComparer<T> comparer)
Parameters
System.Collections.Generic.IEnumerable<T> source

System.Collections.Generic.IEqualityComparer<T> comparer

Returns
System.Collections.Generic.HashSet<T>

Type Parameters
T

ToImmutableList<T>(IEnumerable<T>)
public static ImmutableList<T> ToImmutableList<T>(this IEnumerable<T> source)
Parameters
System.Collections.Generic.IEnumerable<T> source

Returns
ImmutableList<T>

Type Parameters
T