using System; using System.Collections.Generic; namespace Notepad.Infrastructure.Extensions { public static class EnumerableExtensions { public static void Walk(this IEnumerable itemsToWalk) { foreach (var item in itemsToWalk) {} } public static IEnumerable ThatSatisfy(this IEnumerable itemsToPeekInto, Predicate criteriaToSatisfy) { foreach (var item in itemsToPeekInto) { if (item.Satisfies(criteriaToSatisfy)) { yield return item; } } } public static IEnumerable SortedUsing(this IEnumerable itemsToSort, IComparer sortingAlgorithm) { var sortedItems = new List(itemsToSort); sortedItems.Sort(sortingAlgorithm); return sortedItems; } } }