/// <summary>Removes any items in a list that match a criteria</summary>
/// <param name="list">The list.</param>
/// <param name="predicate">The callback used to determine weather or not the item in the list should be removed.</param>
/// <exception cref="ArgumentNullException"><paramref name="predicate"/> is <see langword="null"/></exception>
public static void RemoveAny(this IList list, Predicate<object> predicate )
{
if (predicate == null)
{
throw new ArgumentNullException("predicate");
}
for (var i = list.Count - 1; i >= 0; i--)
{
var item = list[i];
if (predicate(item))
{
list.RemoveAt(i);
}
}
}