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 RecordHeader { public ushort opcode; public ushort length; public ushort textLen; [MarshalAs(UnmanagedType.U1, SizeConst = 1)] public byte zero; } internal class Header : IRecords { RecordHeader header; byte[] m_header; public Header() { header.opcode = 0x14; header.zero = 0x1; } public byte[] Head { set { m_header = value; } } public ushort TextLen { set { header.textLen = value; } } #region IRecords ³ΙΤ± public byte[] GetByte() { int len = 7 + m_header.Length; header.length = (ushort)(len - 4); //header.textLen = (ushort)(len - 7); byte[] b = new byte[len]; Globals.GetStructToBytes(header).CopyTo(b, 0); m_header.CopyTo(b, 7); return b; } #endregion } }