Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="drv"></param>
 /// <param name="obj"></param>
 /// <param name="stringRepresentation"></param>
 protected virtual void UpdateMathForRow(DataRowView drv, object obj, string stringRepresentation)
 {
     if (UpdateMath == null)
     {
         // only calc sum if we need it (save on effort of conversions, etc)
         if (this.displayAvg || this.displaySum)
         {
             try
             {
                 this.sumOfValues += Convert.ToDouble(stringRepresentation);
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex.Message);
             }
         }
         this.countOfValues++;
     }
     else
     {
         UpdateMathEventArgs e = new UpdateMathEventArgs(drv, obj, stringRepresentation);
         e.Count = this.countOfValues;
         e.Sum   = this.sumOfValues;
         UpdateMath(this, e);
         this.sumOfValues   = e.Sum;
         this.countOfValues = e.Count;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="drv"></param>
 /// <param name="obj"></param>
 /// <param name="stringRepresentation"></param>
 protected virtual void UpdateMathForRow(DataRowView drv, object obj, string stringRepresentation)
 {
     if (UpdateMath == null)
     {
         // only calc sum if we need it (save on effort of conversions, etc)
         if (this.displayAvg || this.displaySum)
         {
             try
             {
     //						this.sumOfValues += Convert.ToDouble (stringRepresentation);
                 this.sumOfValues += Convert.ToDouble (obj);
             }
             catch (Exception ex)
             {
                 Console.WriteLine (ex.Message);
             }
         }
         this.countOfValues++;
     }
     else
     {
         UpdateMathEventArgs e = new UpdateMathEventArgs (drv, obj, stringRepresentation);
         e.Count = this.countOfValues;
         e.Sum = this.sumOfValues;
         UpdateMath (this, e);
         this.sumOfValues = e.Sum;
         this.countOfValues = e.Count;
     }
 }