示例#1
0
        public static AbsXLSRec Read(BinaryReader br, AbsXLSRec previousRecord)
        {
            int num1 = br.ReadUInt16();

            if (num1 == 0)
            {
                return(null);
            }
            int           num2        = br.ReadUInt16();
            XLSDescriptor descriptor1 = XLSDescriptors.GetByCode(num1);

            if (!XLSDescriptors.ValidBodySize(descriptor1, num2, false))
            {
                descriptor1 = null;
            }
            if ((descriptor1 != null) && (descriptor1.Name == "FILEPASS"))
            {
                throw new Exception("Current version of ExcelLite can't read encrypted workbooks. You can use only simple password protection against modifying (set in MS Excel 'Save As' dialog).");
            }
            if ((descriptor1 != null) && (descriptor1.HandlerClass != typeof(XLSRecord)))
            {
                object[] objArray1 = new object[] { num2, br, previousRecord };
                return((AbsXLSRec)Activator.CreateInstance(descriptor1.HandlerClass, objArray1));
            }
            return(new XLSRecord(num1, num2, br));
        }
示例#2
0
 public XLSRecord(int recordCode, int bodySize, BinaryReader br)
 {
     this.recordCode = recordCode;
     this.ReadBody(bodySize, br);
     this.descriptor = XLSDescriptors.GetByCode(recordCode);
 }