public static AbsXLSRec Read(BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) { int code = br.ReadUInt16(); if (code == 0) { return(null); } int size = br.ReadUInt16(); XLSDescriptor byCode = XLSDescriptors.GetByCode(code); if (!XLSDescriptors.ValidBodySize(byCode, size, false)) { byCode = null; } if ((byCode != null) && (byCode.Name == "FILEPASS")) { throw new Exception("Current version of ebexcel can't read encrypted workbooks. You can use only simple password protection against modifying (set in MS Excel 'Save As' dialog)."); } if ((byCode != null) && (byCode.HandlerClass != typeof(XLSRecord))) { return((AbsXLSRec)Activator.CreateInstance(byCode.HandlerClass, new object[] { size, br, previousRecord, operationInfo })); } return(new XLSRecord(code, size, br)); }
public static bool ValidBodySize(XLSDescriptor des, int size, bool exception) { if (((des != null) && des.IsFixedSize) && (des.BodySize != size)) { if (des.Code == 430) { throw new Exception("External references are currently not supported."); } string str = string.Concat(new object[] { "Record should have size ", des.BodySize, " and not ", size, "." }); if (exception) { throw new Exception("Internal error: " + str); } return(false); } return(true); }
public XLSRecord(int recordCode, int bodySize, BinaryReader br) { this.recordCode = recordCode; this.ReadBody(bodySize, br); this.descriptor = XLSDescriptors.GetByCode(recordCode); }
protected XLSRecord(XLSDescriptor descriptor, int bodySize, BinaryReader br) { this.recordCode = descriptor.Code; this.ReadBody(bodySize, br); this.descriptor = descriptor; }
protected XLSRecord(XLSDescriptor descriptor) { this.InitializeDescriptorCode(descriptor); }
private void InitializeDescriptorCode(XLSDescriptor descriptor) { this.descriptor = descriptor; this.recordCode = this.descriptor.Code; }
public MsoContainerRecord(XLSDescriptor descriptor, BinaryReader reader, MsoType type) : base(descriptor, reader, type) { this.items = new ArrayList(); this.SetInstanceAndVersion(type); }
public MsoContainerRecord(XLSDescriptor descriptor, MsoType type) : base(descriptor, type) { this.items = new ArrayList(); this.SetInstanceAndVersion(type); base.InitializeBody((byte[])null); }
public SSTRelated(XLSDescriptor descriptor) : base(descriptor) { }
public SSTRelated(XLSDescriptor descriptor, int bodySize, BinaryReader br) : base(descriptor, bodySize, br) { }
public MsoBaseRecord(XLSDescriptor descriptor, int bodyLength, BinaryReader br, MsoType type, IoOperationInfo operationInfo) : base(descriptor, bodyLength, br) { this.type = (ushort)type; this.operationInfo = operationInfo; this.Read(br); }
public MsoBaseRecord(XLSDescriptor descriptor, BinaryReader br, MsoType type) : base(descriptor, 0, br) { this.type = (ushort)type; this.Read(br); }
public MsoBaseRecord(XLSDescriptor descriptor, MsoType type) : base(descriptor) { this.type = (ushort)type; }