Пример #1
0
 public GroupEnumerator(GroupByEnumerator g)
 {
     this.g          = g;
     this.en         = g.en;
     this.field      = g.field;
     this.groupValue = xbind.Resolve(en.Current, field);
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }