예제 #1
0
파일: AbsXLSRec.cs 프로젝트: ikvm/test
        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));
        }
예제 #2
0
파일: XLSDescriptors.cs 프로젝트: ikvm/test
 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);
 }
예제 #3
0
 public XLSRecord(int recordCode, int bodySize, BinaryReader br)
 {
     this.recordCode = recordCode;
     this.ReadBody(bodySize, br);
     this.descriptor = XLSDescriptors.GetByCode(recordCode);
 }
예제 #4
0
 protected XLSRecord(XLSDescriptor descriptor, int bodySize, BinaryReader br)
 {
     this.recordCode = descriptor.Code;
     this.ReadBody(bodySize, br);
     this.descriptor = descriptor;
 }
예제 #5
0
 protected XLSRecord(XLSDescriptor descriptor)
 {
     this.InitializeDescriptorCode(descriptor);
 }
예제 #6
0
 private void InitializeDescriptorCode(XLSDescriptor descriptor)
 {
     this.descriptor = descriptor;
     this.recordCode = this.descriptor.Code;
 }
예제 #7
0
 public MsoContainerRecord(XLSDescriptor descriptor, BinaryReader reader, MsoType type) : base(descriptor, reader, type)
 {
     this.items = new ArrayList();
     this.SetInstanceAndVersion(type);
 }
예제 #8
0
 public MsoContainerRecord(XLSDescriptor descriptor, MsoType type) : base(descriptor, type)
 {
     this.items = new ArrayList();
     this.SetInstanceAndVersion(type);
     base.InitializeBody((byte[])null);
 }
예제 #9
0
파일: SSTRelated.cs 프로젝트: ikvm/test
 public SSTRelated(XLSDescriptor descriptor) : base(descriptor)
 {
 }
예제 #10
0
파일: SSTRelated.cs 프로젝트: ikvm/test
 public SSTRelated(XLSDescriptor descriptor, int bodySize, BinaryReader br) : base(descriptor, bodySize, br)
 {
 }
예제 #11
0
파일: MsoBaseRecord.cs 프로젝트: ikvm/test
 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);
 }
예제 #12
0
파일: MsoBaseRecord.cs 프로젝트: ikvm/test
 public MsoBaseRecord(XLSDescriptor descriptor, BinaryReader br, MsoType type) : base(descriptor, 0, br)
 {
     this.type = (ushort)type;
     this.Read(br);
 }
예제 #13
0
파일: MsoBaseRecord.cs 프로젝트: ikvm/test
 public MsoBaseRecord(XLSDescriptor descriptor, MsoType type) : base(descriptor)
 {
     this.type = (ushort)type;
 }