CSharp examples for System.Collections:IEnumerable
True value in IEnumerable For All by Predicate
using System.Collections.Generic; using System.Collections; using System;/*from w w w .ja va2 s .c om*/ public class Main{ internal static bool TrueForAll<T>(IEnumerable<T> collection, Predicate<T> predicate) { if (collection == null) throw new ArgumentNullException("collection"); if (predicate == null) throw new ArgumentNullException("predicate"); foreach (T item in collection) { if (!predicate(item)) return false; } return true; } }