Calcmode.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 RecordCalcmode
  10. {
  11. public ushort opcode; // 0xD;
  12. public ushort length;
  13. public ushort auto;
  14. public ushort calc1;
  15. public ushort calc2;
  16. public ushort calcstandard;
  17. }
  18. internal class Calcmode : IRecords
  19. {
  20. RecordCalcmode calcmode;
  21. public Calcmode()
  22. {
  23. calcmode.opcode = 0xD;
  24. calcmode.length = 0x2;
  25. calcmode.auto = 0x1; // ÉèΪ×Ô¶¯
  26. //// Also add the Calc Count record
  27. calcmode.calc1 = 0xC;
  28. calcmode.calc2 = 0x2;
  29. calcmode.calcstandard = 0x64;
  30. }
  31. #region IRecords ³ÉÔ±
  32. public byte[] GetByte()
  33. {
  34. //byte[] b = new byte[11];
  35. //b[0] = (byte)calcmode.opcode;
  36. //b[2] = (byte)calcmode.length;
  37. //b[4] = 0x1; // set to automatic recalc
  38. //// Also add the Calc Count record
  39. //b[6] = 0xC;
  40. //b[8] = 0x2;
  41. //b[10] = 0x64; //100 is standard
  42. //return b;
  43. return Globals.GetStructToBytes(calcmode);
  44. }
  45. #endregion
  46. }
  47. }