public delegate TResult Func<TSource, TResult>(TSource source);
public static class ComplementEnumerable
{
public static IEnumerable<TResult> Select<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, TResult> selector)
foreach (TSource s in source)
yield return selector.Invoke(s);
}
public static float Average(IEnumerable<float> source)
double num1 = 0;
long num2 = 0;
foreach (float num3 in source)
num1 += num3;
num2++;
return (float)(num1 / (double)num2);
public static float Average<TSource>(IEnumerable<TSource> Source, Func<TSource, float> selector)
return ComplementEnumerable.Average(ComplementEnumerable.Select<TSource, float>(Source, selector));
public static IEnumerable<TSource> Where<TSource>(IEnumerable<TSource> source, Func<TSource, bool> selector)
if (selector.Invoke(s))
yield return s;
IEnumerable<IEnumerable<NoteENT>> t = ComplementEnumerable.Select<EleveENT, IEnumerable<NoteENT>>(l,
delegate(EleveENT c) { return c.Notes; });
var t = ComplementEnumerable.Select<EleveENT, IEnumerable<NoteENT>>(l, delegate(EleveENT c) { return c.Notes; });
var u = ComplementEnumerable.Select(l, delegate(EleveENT c) { return c.Notes; });
IEnumerable<IEnumerable<float>> t = ComplementEnumerable.Select<EleveENT, IEnumerable<float>>(l, delegate(EleveENT c)
return ComplementEnumerable.Select<NoteENT, float>(ComplementEnumerable.Where<NoteENT>(c.Notes,
delegate(NoteENT n)
{ return n.Date >= new DateTime(2007,4,1); }), delegate(NoteENT n)
{ return n.Note; }
);
});
var r = ComplementEnumerable.Select(l, delegate(EleveENT c)
return ComplementEnumerable.Select(ComplementEnumerable.Where(c.Notes, delegate(NoteENT n)
delegate(NoteENT n) { return n.Note; }
(NoteENT f) => f.Note
{ return n.Date >= new DateTime(2007,4,1); }), (NoteENT f) => f.Note);
var r = ComplementEnumerable.Select(l, c =>
ComplementEnumerable.Select(ComplementEnumerable.Where(c.Notes, n =>
n.Date >= new DateTime(2007,4,1)),f => f.Note)