SetElement() приватный Метод

Puts Cell to the Row at the position given, doesn't reserve colspan.
private SetElement ( Object aElement, nint column ) : void
aElement Object the cell to add.
column nint the position where to add the cell.
Результат void
Пример #1
0
        /// <summary>
        /// Gives you the posibility to add columns.
        /// </summary>
        /// <param name="aColumns">the number of columns to add</param>
        public void AddColumns(int aColumns) {
            ArrayList newRows = new ArrayList(rows.Count);

            int newColumns = columns + aColumns;
            Row row;
            for (int i = 0; i < rows.Count; i++) {
                row = new Row(newColumns);
                for (int j = 0; j < columns; j++) {
                    row.SetElement(((Row) rows[i]).GetCell(j) ,j);
                }
                for (int j = columns; j < newColumns && i < curPosition.X; j++) {
                    row.SetElement(null, j);
                }
                newRows.Add(row);
            }

            // applied 1 column-fix; last column needs to have a width of 0
            float [] newWidths = new float[newColumns];
            System.Array.Copy(widths, 0, newWidths, 0, columns);
            for (int j = columns; j < newColumns ; j++) {
                newWidths[j] = 0;
            }
            columns = newColumns;
            widths = newWidths;
            rows = newRows;
        }