예제 #1
0
        private void ReadColumns(BinaryReader reader, CremaBinaryTable table, int columnCount)
        {
            var keys         = new List <IColumn>();
            var columns      = new CremaBinaryColumnCollection(table, columnCount, this.CaseSensitive);
            var tableStrings = StringResource.GetTableStrings(table);

            for (var i = 0; i < columnCount; i++)
            {
                var columninfo = reader.ReadValue <ColumnInfo>();
                var columnName = tableStrings.GetString(columninfo.ColumnName);
                var typeName   = tableStrings.GetString(columninfo.DataType);
                var isKey      = columninfo.Iskey == 0 ? false : true;

                var column = new CremaBinaryColumn(columnName, Utility.NameToType(typeName), isKey);
                columns.Add(column);
                if (isKey == true)
                {
                    keys.Add(column);
                }

                column.Table = table;
            }
            table.Columns = columns;
            table.Keys    = keys.ToArray();
        }
예제 #2
0
 public void Add(CremaBinaryColumn item)
 {
     item.Index = this.columns.Count;
     this.columns.Add(item.Name, item);
 }