// // // // // $Revision$ // using System; using System.Collections.Generic; namespace ICSharpCode.SharpDevelop { /// /// A set of methods that replicate some of the LINQ functionality. /// /// /// Will be removed when SharpDevelop is compiled with C# 3.0. /// public static class Linq { /// /// Applies a conversion function to all elements in the input. /// public static IEnumerable Select(IEnumerable input, Converter converter) { foreach (T element in input) { yield return converter(element); } } /// /// Returns only the elements in input for which filter is true. /// public static IEnumerable Where(IEnumerable input, Predicate filter) { foreach (T element in input) { if (filter(element)) yield return element; } } } }