public GroupEnumerator(GroupByEnumerator g) { this.g = g; this.en = g.en; this.field = g.field; this.groupValue = xbind.Resolve(en.Current, field); }
public override bool MoveNext() { if (!base.MoveNext()) { return(false); } if (last == first) { last = ctx.Resolve(base.Current, propertyName); return(true); } object old = last; bool next = true; do { last = ctx.Resolve(base.Current, propertyName); } while (IsEqualToLast(old) && (next = base.MoveNext())); return(next); }
public decimal Sum(IEnumerable en, string propertyName) { decimal sum = 0; var xb = new XBindContext(); foreach (object obj in en) { object val = xb.Resolve(obj, propertyName); if (val != null) { sum += Convert.ToDecimal(val); } } return(sum); }