//Copy all rows from source to target via clone public static void CopyRows(TableRows source, TableRows target) { foreach (TableRow row in source) { target.Add((TableRow)row.Clone()); } }
private IOperation CreateRowRemovingFromTableOperation(string[] row) { TableRow tempDeletedRow = new TableRow(row); System.Action redo = () => { Execute.OnUIThread(() => { if (!TableRows.Remove(new TableRow(row))) { tempDeletedRow = null; return; } NotifyOfPropertyChange(() => TableRows); }); }; System.Action undo = () => { Execute.OnUIThread(() => { if (tempDeletedRow != null) { TableRows.Add(tempDeletedRow); NotifyOfPropertyChange(() => TableRows); } }); }; return(new SimpleOperation(redo, undo)); }
/// <summary> /// Advances the SqlDataReader to the next record. /// </summary> public override bool Read() { if (!_dbReader.Read()) { return(false); } _rowValues = new object[_dbReader.FieldCount]; for (var i = 0; i < _dbReader.FieldCount; i++) { if (IsBinary(i)) { _rowValues[i] = GetSqlBytes(i); } else { _rowValues[i] = _dbReader.GetValue(i); } } _tableRows?.Add(new TableRow(_rowValues) { Depth = _dbReader.Depth }); return(true); }
private IOperation CreateAddingToTableOperation(params string[] row) { var tempIsTableVisibile = IsTableVisible; var newRow = new TableRow(row); System.Action redo = () => { Execute.OnUIThread(() => { TableRows.Add(newRow); NotifyOfPropertyChange(() => TableRows); }); ShowTable(); }; System.Action undo = () => { Execute.OnUIThread(() => { TableRows.RemoveLast(newRow); NotifyOfPropertyChange(() => TableRows); }); if (tempIsTableVisibile) { ShowTable(); } else { HideTable(); } }; return(new SimpleOperation(redo, undo)); }
public void AddTableRow(DynamicTableEntity tableEntity) { TableRows.Add(tableEntity); SortTableRows(); }