/// <summary> /// Insert the specified cell /// </summary> /// <param name="row"></param> /// <param name="col"></param> /// <param name="p_cell"></param> private void InsertCell(int row, int col, Cells.ICell p_cell) { RemoveCell(row, col); if (p_cell != null && p_cell.Grid != null) { throw new ArgumentException("This cell already have a linked grid", "p_cell"); } DirectSetCell(new Position(row, col), p_cell); if (p_cell != null) { p_cell.BindToGrid(this, new Position(row, col)); } }
/// <summary> /// Insert the specified cell (for best performance set Redraw property to false) /// </summary> /// <param name="row"></param> /// <param name="col"></param> /// <param name="p_cell"></param> public virtual void InsertCell(int row, int col, Cells.ICell p_cell) { RemoveCell(row, col); m_Cells[row, col] = p_cell; if (p_cell != null) { if (p_cell.Grid != null) { throw new ArgumentException("This cell already have a linked grid", "p_cell"); } p_cell.BindToGrid(this, new Position(row, col)); p_cell.Invalidate(); } }