public void Save(IniFile af, Int32 iRowKey) { foreach (short ColKey in Owner.Columns.ColKeys) // for each column { CColumn c = Owner.Columns[ColKey]; af["R" + iRowKey.toString()][c.Name] = Owner.Rows[iRowKey][c.Name].Value; // lookup value from file } }
public CColumn Add(CColumn column) { column.Owner = this; Nonce--; base[Nonce] = column; column.Key = Nonce; ColKeys = Keys.OrderByDescending(x => x); return((CColumn)column); }
public CRow(CRows aOwner) : base() { Owner = aOwner; foreach (short key in Owner.Cols.ColKeys) { CColumn aCol = Owner.Cols[key]; CField aField = Add(new CField(this, aCol, "")); } }
public CColumn First() { CColumn c = null; if (Keys.Count > 0) { short k = base.Keys.OrderBy(x => x).First(); c = (CColumn)this[k]; } return(c); }
public CRow Load(IniFile af, Int32 iRowKey) { CRow r = Add(new CRow(this)); foreach (short ColKey in Owner.Columns.ColKeys) // for each column { CColumn c = Owner.Columns[ColKey]; Owner.Rows[r.Key][c.Name].Value = af["R" + iRowKey.toString()][c.Name].toString(); // lookup value from file } return(r); }
public CField(CRow aRow, CColumn aCol, string aValue) : base() { Owner = aRow; Column = aCol; Value = aValue; }