public string Pad(Field fld) { int colMaxLen = fld.Column.MaxLength; return fld.Value.PadRight(colMaxLen); }
public Field[] this[Row row] { get{ Field[] flds = new Field[this._table.Columns.Count]; int i = 0; bool filled = false; foreach(Field fld in _table.Fields){ if (fld.Row == row){ flds[i++] = fld; filled = true; } } if (!filled){ foreach(Column col in _table.Columns){ Field fld= new Field(_table, row, col); flds[i++] = fld; List.Add(fld); } } return flds; } }
public Field Add(Field fld) { List.Add(fld); return fld; }
public Field this[Column col, int row] { get{ foreach(Field fld in _table.Fields){ if (fld.Column.Id == col.Id && fld.Row.Id == row){ return fld; } } Field ret = new Field(_table, row, col); List.Add(ret); return ret; } }