RK.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 RecordRK
  10. {
  11. public ushort opcode;
  12. public ushort length;
  13. public ushort row;
  14. public ushort col;
  15. public ushort xf;
  16. public uint rk;
  17. }
  18. internal class RK : IRecords
  19. {
  20. RecordRK rk;
  21. public RK()
  22. {
  23. rk.opcode = 0x27E;
  24. rk.length = 0xA;
  25. }
  26. public ushort Row
  27. {
  28. set { rk.row = value; }
  29. }
  30. public ushort Column
  31. {
  32. set { rk.col = value; }
  33. }
  34. public ushort CellStyle
  35. {
  36. set { rk.xf = value; }
  37. }
  38. public uint Value
  39. {
  40. set
  41. {
  42. rk.rk = (value << 2) | 0x2;
  43. //rk.rk |= 0x2;
  44. }
  45. }
  46. #region IRecords ³ÉÔ±
  47. public byte[] GetByte()
  48. {
  49. return Globals.GetStructToBytes(rk);
  50. }
  51. #endregion
  52. }
  53. }