public BomDataCell this[BomDataColumn column] { get { foreach (BomDataCell cell in this) { if (column.Equals(cell.Column)) { return(cell); } } return(null); } }
public BomDataRowHolder(BomDataRowHolder copyRow, BomDataColumn replaceColumn, object newValue) { foreach (BomDataCell cell in copyRow) { if (cell.Column.Equals(replaceColumn)) { this.Add(new BomDataCell(this, replaceColumn, newValue)); } else { this.Add(new BomDataCell(this, cell.Column, cell.Value)); } } }
private void FixCopyColumnValues(DataTable copiedTable) { foreach (BomDataColumn copyColumn in copiedTable.Columns) { BomDataColumn originalColumn = (BomDataColumn)_dataTable.Columns[copyColumn.ColumnName]; copyColumn.OutputName = originalColumn.OutputName; copyColumn.Overrides = originalColumn.Overrides; copyColumn.Position = originalColumn.Position; copyColumn.ColumnName = originalColumn.ColumnName; copyColumn.HeaderName = originalColumn.HeaderName; copyColumn.IsSplit = originalColumn.IsSplit; copyColumn.Delimeter = originalColumn.Delimeter; copyColumn.IsQuantity = originalColumn.IsQuantity; } }
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 'BomDataTable.AddColumn(BomDataColumn)' public void AddColumn(BomDataColumn column) { #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member 'BomDataTable.AddColumn(BomDataColumn)' if (column.Position < 0 || column.Position > GetColumnCount()) { _addColumn(column); } else if (column.Position == GetColumnCount()) { _addColumn(column); for (int i = GetColumnCount() - 1; i >= 0; i--) { BomDataColumn bomColumn = GetColumn(i); if (column.Position < bomColumn.Position || bomColumn.Position < 0) { MoveColumn(column, bomColumn.Ordinal); } } } else { if (GetColumnPosition(column.Position) == column.Position) { if (column.Overrides) { RemoveColumn(column.Position); _addColumn(column); MoveColumn(GetColumnCount() - 1, column.Position); } } else { _addColumn(column); MoveColumn(GetColumnCount() - 1, column.Position); } } }
private void MoveColumn(BomDataColumn columnToMove, int ordinal) { MoveColumn(_dataTable.Columns.IndexOf(columnToMove), ordinal); }
private void _addColumn(BomDataColumn column) { _dataTable.Columns.Add(column); }
private void RemoveColumn(BomDataColumn column) { _dataTable.Columns.Remove(column); }