12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Runtime.InteropServices;
- using Biff8Excel.Interfaces;
- namespace Biff8Excel.Records
- {
- [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
- struct RecordFormat
- {
- public ushort opcode;
- public ushort length;
- public ushort index;
- public ushort formatlen;
- }
- internal class Format : IRecords
- {
- RecordFormat format;
- byte[] m_strings;
- //int m_formatlen;
- public Format()
- {
- format.opcode = 0x41E;
- }
- public ushort Index
- {
- set {format.index = value;}
- }
- public string FormatString
- {
- set
- {
- m_strings = Globals.GetDefaultBytes(value);
- format.formatlen = (ushort)m_strings.Length;
- }
- }
- public ushort ID
- {
- get {return format.opcode;}
- }
- public ushort RecordSize
- {
- get {return (ushort)(9 + format.formatlen) ; }
- }
- #region IRecords ³ÉÔ±
- public byte[] GetByte()
- {
- byte[] b;
- int len = 9 + format.formatlen;
- b = new byte[len];
- format.length = (ushort)(len - 4);
- Globals.GetStructToBytes(format).CopyTo(b, 0);
- b[8] = 0;
- m_strings.CopyTo(b, 9);
- return b;
- }
- #endregion
- }
- }
|