BOF.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Runtime.InteropServices;
  5. using Biff8Excel.Interfaces;
  6. namespace Biff8Excel.Records
  7. {
  8. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
  9. struct RecordBOF
  10. {
  11. public ushort opcode; // 0x809;
  12. public ushort length; // 0x10;
  13. public ushort version; // 0x600;
  14. public EnumBofTypes type;
  15. public ushort build; // 0x27F3;
  16. public ushort year; // 0x7CD; //1997
  17. public uint history; // 0x40C9;
  18. public uint rversion; // 0x106;
  19. }
  20. internal enum EnumBofTypes : ushort
  21. {
  22. bofWorkbook = 0x5,
  23. bofWorkSheet = 0x10
  24. }
  25. internal class BOF : IRecords
  26. {
  27. RecordBOF bof;
  28. public BOF()
  29. {
  30. bof.opcode = 0x809;
  31. bof.length = 0x10;
  32. bof.type = EnumBofTypes.bofWorkbook ;
  33. bof.version = 0x600;
  34. bof.year = 0x7CD;
  35. bof.build = 0x27F3;
  36. bof.history = 0x40C9;
  37. bof.rversion = 0x106;
  38. //bof.build = 0x19A0;
  39. //bof.history = 0xC0;
  40. //bof.rversion = 0x306;
  41. }
  42. internal EnumBofTypes DataType
  43. {
  44. set{ bof.type = value;}
  45. }
  46. internal ushort Id
  47. {
  48. get{return bof.opcode ;}
  49. }
  50. #region IRecords ³ÉÔ±
  51. public byte[] GetByte()
  52. {
  53. return Globals.GetStructToBytes(bof);
  54. }
  55. #endregion
  56. }
  57. }