public static void Print <T, K>(IGroupEnumerator <T, K> e) { while (e.MoveNextGroup()) { Console.WriteLine(e.CurrentKey); Console.WriteLine("-----------"); while (e.MoveNext()) { Console.WriteLine(" " + e.Current); } } }
static void Main(string[] args) { IGroupEnumerator <int, bool> myEnumerador = Grouper.GroupBy <int, bool>(new int[] { 2, 4, 5, 7, 9, 10, 14, 132 }, new ParitySelector()); Print <int, bool>(myEnumerador); }