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 RecordCalcmode { public ushort opcode; // 0xD; public ushort length; public ushort auto; public ushort calc1; public ushort calc2; public ushort calcstandard; } internal class Calcmode : IRecords { RecordCalcmode calcmode; public Calcmode() { calcmode.opcode = 0xD; calcmode.length = 0x2; calcmode.auto = 0x1; // 设为自动 //// Also add the Calc Count record calcmode.calc1 = 0xC; calcmode.calc2 = 0x2; calcmode.calcstandard = 0x64; } #region IRecords 成员 public byte[] GetByte() { //byte[] b = new byte[11]; //b[0] = (byte)calcmode.opcode; //b[2] = (byte)calcmode.length; //b[4] = 0x1; // set to automatic recalc //// Also add the Calc Count record //b[6] = 0xC; //b[8] = 0x2; //b[10] = 0x64; //100 is standard //return b; return Globals.GetStructToBytes(calcmode); } #endregion } }