Row GetRow(int idx)
        {
            MemoryStream stream = new MemoryStream(data);
            BinaryReader reader = new BinaryReader(stream);

            reader.BaseStream.Position = _rowSize * idx;

            TableCell[] cells = new TableCell[_colDescs.Length];
            for (int i = 0; i < _colDescs.Length; i++)
            {
                ColDesc cd = _colDescs[i];
                //uint valu = ReadSingleValue(_colDescs[i].Type, reader);
                //cells[i] = new TableCell(valu, _helper);
                cells[i] = new TableCell(_colDescs[i].Type, reader, _helper);
            }

            stream.Close();

            return(new Row(cells, this));
        }
        public Table(Types type, Types[] colTypes, String[] colNames, MDTables helper, BinaryReader reader)
        {
            _type   = type;
            _helper = helper;

            _colDescs = new ColDesc[colTypes.Length];

            for (int i = 0; i < _colDescs.Length; i++)
            {
                _colDescs[i] = new ColDesc(colTypes[i], colNames[i]);
            }

            _rows = new Row[helper.GetTableRows(type)];

            _rowSize = 0;
            foreach (ColDesc cd in _colDescs)
            {
                _rowSize += _helper.SizeOfType(cd.Type);
            }

            data = reader.ReadBytes(_rowSize * Count);
        }
Beispiel #3
0
        public Table(Types type, Types[] colTypes, String[] colNames, MDTables helper, BinaryReader reader)
        {
            _type = type;
            _helper = helper;

            _colDescs = new ColDesc[colTypes.Length];

            for (int i = 0; i < _colDescs.Length; i++)
            {
                _colDescs[i] = new ColDesc(colTypes[i], colNames[i]);
            }

            _rows = new Row[helper.GetTableRows(type)];

            _rowSize = 0;
            foreach (ColDesc cd in _colDescs)
            {
                _rowSize += _helper.SizeOfType(cd.Type);
            }

            data = reader.ReadBytes(_rowSize*Count);
        }