12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- 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 RecordLabel
- {
- public ushort opcode; // 0x0204
- public ushort length;
- public ushort row;
- public ushort col;
- public ushort xf; // 0xF;
- public ushort TextLength;
- }
- internal class Label : IRecords
- {
- RecordLabel label;
- public Label()
- {
- label.opcode = 0x0204;
- label.xf = 0xf;
- }
- public ushort Row
- {
- set { label.row = value; }
- }
- public ushort Column
- {
- set { label.col = value; }
- }
- public ushort CellStyle
- {
- set { label.xf = value; }
- }
- public string LabelCaption
- {
- set
- {
- if (value == null)
- return;
- label.TextLength = (ushort)Globals.GetDefaultBytesLength(value);
- label.length = (ushort)(8 + label.TextLength);
- }
- }
- #region IRecords ³ÉÔ±
- public byte[] GetByte()
- {
- return Globals.GetStructToBytes(label);
- }
- #endregion
- }
- }
|