/// <summary> /// Raises the BeforeChange event /// </summary> /// <param name="e">A CellEditEventArgs that contains the event data</param> protected virtual void OnBeforeChange(DoubleCellEditEventArgs 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(); } double newValue = this.currentValue; if (newValue > (double.MaxValue - this.increment)) { newValue = double.MaxValue; } else { newValue += this.increment; if (newValue > this.maximum) { newValue = this.maximum; } } //Cell source, ICellEditor editor, Table table, int row, int column, Rectangle cellRect DoubleCellEditEventArgs e = new DoubleCellEditEventArgs(this.cell, this, this.table, this.cell.Row.Index, this.cellPos.Column, this.cellRect, this.currentValue) { NewValue = newValue }; this.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(); } double num = this.currentValue; if (num < (double.MinValue + this.increment)) { num = double.MinValue; } else { num -= this.increment; if (num < this.minimum) { num = this.minimum; } } DoubleCellEditEventArgs e = new DoubleCellEditEventArgs(this.cell, this, this.table, this.cell.Row.Index, this.cellPos.Column, this.cellRect, this.currentValue) { NewValue = num }; OnBeforeChange(e); if (!e.Cancel) { this.Value = e.NewValue; } }