private void InitColsForTable(uint tableIdx) { int prevSize = 0; CMiniColDef[] columns = m_TableDefs[tableIdx].m_pColDefs; int nColumns = columns.Length; // update sizes + offsets for (int i = 0; i < nColumns; i++) { int colType = columns[i].m_Type; int fieldSize = ColumnTypeSize(colType); columns[i] = new CMiniColDef((byte)colType, (byte)prevSize, (byte)fieldSize); // align to 2 byte boundary fieldSize += (fieldSize & 1); prevSize += fieldSize; } byte key = m_TableDefs[tableIdx].m_iKey; if (key >= nColumns) { key = unchecked ((byte)(~0u)); } // update key and total size m_TableDefs[tableIdx] = new CMiniTableDef( m_TableDefs[tableIdx].m_pColDefs, key, prevSize, m_TableDefs[tableIdx].m_RecordType ); }
public CMiniTableDefEx(CMiniTableDef def, string[] colNames, string name) { m_Def = def; m_pColNames = colNames; m_pName = name; }