Dimensions.cs 1.4 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 RecordDimensions
  10. {
  11. public ushort opcode ;
  12. public ushort length;
  13. public uint firstRow;
  14. public uint lastRow;
  15. public ushort firstCol;
  16. public ushort lastCol;
  17. public ushort zero; // last 2 bytes not used
  18. }
  19. internal class Dimensions : IRecords
  20. {
  21. RecordDimensions dimensions;
  22. public Dimensions()
  23. {
  24. dimensions.opcode = 0x200;
  25. dimensions.length = 0xE;
  26. dimensions.zero = 0x0;
  27. }
  28. public ushort ID
  29. {
  30. get {return dimensions.opcode;}
  31. }
  32. public uint FirstRow
  33. {
  34. set { dimensions.firstRow = value; }
  35. }
  36. public uint LastRow
  37. {
  38. set { dimensions.lastRow = value; }
  39. }
  40. public ushort FirstColumn
  41. {
  42. set {dimensions.firstCol = value;}
  43. }
  44. public ushort LastColumn
  45. {
  46. set {dimensions.lastCol = value;}
  47. }
  48. #region IRecords ³ÉÔ±
  49. public byte[] GetByte()
  50. {
  51. return Globals.GetStructToBytes(dimensions);
  52. }
  53. #endregion
  54. }
  55. }