12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Runtime.InteropServices;
- using Biff8Excel.Interfaces;
- namespace Biff8Excel.Records
- {
- [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
- struct RecordINdex
- {
- public ushort opcode;
- public ushort length;
- public uint notUsed;
- public uint firstrowUsed; //zero based
- public uint lastRowUsedplus; //zero based
- public uint defColOffset;
- }
- internal class INdex : IRecords
- {
- RecordINdex index;
- int m_NumberOfRowBlocks;
- uint[] m_RowBlockOffsets;
- public INdex()
- {
- index.opcode = 0x20B;
- index.firstrowUsed = 0x0;
- index.lastRowUsedplus = 0x0;
- }
- public ushort ID
- {
- get {return index.opcode;}
- }
- public ushort RecordSize
- {
- get { return (ushort)(20 + 4 * m_NumberOfRowBlocks);}
- }
- public uint FirstRowIndex
- {
- set { index.firstrowUsed = value; }
- }
- public uint LastRowIndex
- {
- set { index.lastRowUsedplus = value; }
- }
- public uint DefColumnRecordOffset
- {
- set { index.defColOffset = value; }
- }
- public uint[] DBCellOffsets
- //public List<int> DBCellOffsets
- {
- set
- {
- //m_NumberOfRowBlocks = (int)value.Length;
- m_NumberOfRowBlocks = value.Length;
- m_RowBlockOffsets = value;
- }
- }
- #region IRecords ³ÉÔ±
- public byte[] GetByte()
- {
- byte[] b;
- int ln = 20 + (4 * m_NumberOfRowBlocks);
- b = new byte[ln];
- index.length = (ushort)(ln - 4);
- Globals.GetStructToBytes(index).CopyTo(b, 0);
- int pos = 20;
- for (int i = 0; i < m_NumberOfRowBlocks; i++, pos += 4)
- {
- BitConverter.GetBytes(m_RowBlockOffsets[i]).CopyTo(b, pos);
- }
- return b;
- }
- #endregion
- }
- }
|