PrintGridLines.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 RecordPrintGridLines
  10. {
  11. public ushort opcode;
  12. public ushort length;
  13. public ushort print;
  14. }
  15. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
  16. struct RecordGridSet
  17. {
  18. public ushort opcode;
  19. public ushort length;
  20. public ushort printchanged;
  21. }
  22. internal class PrintGridLines : IRecords
  23. {
  24. RecordPrintGridLines printgridlines;
  25. RecordGridSet gridset;
  26. public PrintGridLines()
  27. {
  28. printgridlines.opcode = 0x2B;
  29. printgridlines.length = 0x2;
  30. gridset.opcode = 0x82;
  31. gridset.length = 0x2;
  32. gridset.printchanged = 0x1;
  33. }
  34. public ushort PrintLines
  35. {
  36. set
  37. {
  38. printgridlines.print = value;
  39. }
  40. }
  41. #region IRecords ³ÉÔ±
  42. public byte[] GetByte()
  43. {
  44. byte[] b = new byte[12];
  45. Globals.GetStructToBytes(printgridlines).CopyTo(b, 0);
  46. // Create a GRIDSET Record
  47. Globals.GetStructToBytes(gridset).CopyTo(b, 6);
  48. //b[6] = 0x82;
  49. //b[8] = 0x2;
  50. //b[10] = 0x1;
  51. return b;
  52. }
  53. #endregion
  54. }
  55. }