public void Deserialize(Common.Serialization.IO.CompactReader reader) { _rowCount = reader.ReadInt32(); //this.ColumnCount = reader.ReadInt32(); for (int i = 0; i < this.ColumnCount; i++) { string key = reader.ReadObject() as string; RecordColumn col = reader.ReadObject() as RecordColumn; _dataStringIndex.Add(key, col); _dataIntIndex.Add(i, col); } }
/// <summary> /// Adds a new column in <see cref="Alachisoft.NosDB.Common.DataStructures.Recordset"/> /// </summary> /// <param name="columnName">Name of column</param> /// <param name="isHidden">IsHidden property of column</param> /// <param name="columnType"></param> /// <param name="aggregateFunctionType"></param> /// <returns>fasle if column with same name already exists, true otherwise</returns> public bool AddColumn(string columnName, bool isHidden, ColumnType columnType, AggregateFunctionType aggregateFunctionType) { if (_dataStringIndex.ContainsKey(columnName)) { return(false); } RecordColumn column = new RecordColumn(columnName, isHidden); column.Type = columnType; column.AggregateFunctionType = aggregateFunctionType; _dataIntIndex[this.ColumnCount] = column; _dataStringIndex[columnName] = column; if (isHidden) { _hiddenColumnCount++; } return(true); }