/// <summary> /// Raises the BeforeChange event /// </summary> /// <param name="e">A CellEditEventArgs that contains the event data</param> protected virtual void OnBeforeChange(NumericCellEditEventArgs e) { if (this.BeforeChange != null) this.BeforeChange(this, e); }
/// <summary> /// Simulates the up button being pressed /// </summary> protected void UpButton() { if (this.UserEdit) { this.ParseEditText(); } decimal num = this.currentValue; if (num > (new decimal(-1, -1, -1, false, 0) - this.increment)) { num = new decimal(-1, -1, -1, false, 0); } else { num += this.increment; if (num > this.maximum) { num = this.maximum; } } //Cell source, ICellEditor editor, Table table, int row, int column, Rectangle cellRect NumericCellEditEventArgs e = new NumericCellEditEventArgs(this.cell, this, this.table, this.cell.Row.Index, this.cellPos.Column, this.cellRect, this.currentValue); e.NewValue = num; OnBeforeChange(e); if (!e.Cancel) this.Value = e.NewValue; }
/// <summary> /// Simulates the down button being pressed /// </summary> protected void DownButton() { if (this.UserEdit) { this.ParseEditText(); } decimal num = this.currentValue; if (num < (new decimal(-1, -1, -1, true, 0) + this.increment)) { num = new decimal(-1, -1, -1, true, 0); } else { num -= this.increment; if (num < this.minimum) { num = this.minimum; } } NumericCellEditEventArgs e = new NumericCellEditEventArgs(this.cell, this, this.table, this.cell.Row.Index, this.cellPos.Column, this.cellRect, this.currentValue); e.NewValue = num; OnBeforeChange(e); if (!e.Cancel) this.Value = e.NewValue; }