public void SaveRows() { if (Rows.Count > 0) { IniFile f = IniFile.FromFile(FileName); IOrderedEnumerable <Int32> r = Rows.Keys.OrderByDescending(x => x); string sRowIndex = ""; foreach (Int32 RowKey in r) { sRowIndex = sRowIndex + RowKey.toString() + ";"; Rows.Save(f, RowKey); } sRowIndex = sRowIndex.toBase64EncryptStr(); f["A"]["RowIndex"] = sRowIndex; f.Save(FileName); } }
public void SaveTable() { IniFile f = IniFile.FromFile(FileName); // Column Index, list of keys by delimited by semicolon IOrderedEnumerable <short> k = Columns.Keys.OrderByDescending(x => x); string sColIndex = ""; foreach (short key in k) { sColIndex = sColIndex + key.toString() + ";"; } sColIndex = sColIndex.toBase64EncryptStr(); f["A"]["ColumnIndex"] = sColIndex; CColumn c; foreach (short key in k) { c = (CColumn)Columns[key]; string sI = c.Key.toString(); f["C" + sI]["Ca"] = c.Caption; f["C" + sI]["Na"] = c.Name;; f["C" + sI]["Ty"] = c.ColType.ToString(); } if (Rows.Count > 0) { IOrderedEnumerable <Int32> r = Rows.Keys.OrderByDescending(x => x); string sRowIndex = ""; foreach (Int32 RowKey in r) { sRowIndex = sRowIndex + RowKey.toString() + ";"; Rows.Save(f, RowKey); } sRowIndex = sRowIndex.toBase64EncryptStr(); f["A"]["RowIndex"] = sRowIndex; } f.Save(FileName); }