Esempio n. 1
0
 public BoundSheetRecord(ExcelShortString sheetName, AbsXLSRec sheetBOFRecord)
     : base(staticDescriptor)
 {
     base.InitializeBody((byte[])null);
     this.SheetName      = sheetName;
     this.sheetBOFRecord = sheetBOFRecord;
 }
Esempio n. 2
0
 public ExtSSTRecord(int stringsInBucket, int offset, AbsXLSRec sstRecord) : base(staticDescriptor)
 {
     base.InitializeBody((byte[])null);
     this.stringsInBucket = stringsInBucket;
     this.offset          = offset;
     this.sstRecord       = sstRecord;
 }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
 public SSTRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
     : base(staticDescriptor, bodyLength, br)
 {
     object[] arguments = base.GetArguments();
     this.TotalStringCount  = (int)((uint)arguments[0]);
     this.UniqueStringCount = (int)((uint)arguments[1]);
     base.ExcelStrings      = (ExcelLongStrings)arguments[2];
 }
Esempio n. 5
0
        public ContinueRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
        {
            SSTRelated related = previousRecord as SSTRelated;

            if ((related != null) && (related.ExcelStrings != null))
            {
                using (MemoryStream stream = new MemoryStream(this.Body))
                {
                    using (BinaryReader reader = new BinaryReader(stream, new UnicodeEncoding()))
                    {
                        base.ExcelStrings = new ExcelLongStrings(reader, bodyLength, related.ExcelStrings);
                    }
                }
            }
        }
Esempio n. 6
0
        public void Read(BinaryReader br, IoOperationInfo operationInfo)
        {
            AbsXLSRec previousRecord = null;

Label_0002:
            if (br.PeekChar() != -1)
            {
                try
                {
                    previousRecord = AbsXLSRec.Read(br, previousRecord, operationInfo);
                }
                catch (Exception exception)
                {
                    string message = exception.Message;
                }
                while (previousRecord != null)
                {
                    this.Add(previousRecord);
                    goto Label_0002;
                }
            }
        }
Esempio n. 7
0
 protected override void InitializeDelayed()
 {
     if (this.FirstRow == null)
     {
         object[] args = new object[2];
         args[0] = 0;
         object[] objArray2 = new object[0];
         args[1] = objArray2;
         base.InitializeDelayed(args);
     }
     else
     {
         int       num2;
         uint      num = (uint)(base.Address - this.FirstRow.Address);
         AbsXLSRec rec = this;
         for (num2 = this.StartingCellsForRows.Count - 1; num2 >= 0; num2--)
         {
             if (this.StartingCellsForRows[num2] == null)
             {
                 this.StartingCellsForRows[num2] = rec;
             }
             else
             {
                 rec = (AbsXLSRec)this.StartingCellsForRows[num2];
             }
         }
         object[] objArray3 = new object[this.StartingCellsForRows.Count];
         int      num3      = this.FirstRow.Address + 20;
         for (num2 = 0; num2 < this.StartingCellsForRows.Count; num2++)
         {
             int address = ((AbsXLSRec)this.StartingCellsForRows[num2]).Address;
             objArray3[num2] = (ushort)(address - num3);
             num3            = address;
         }
         base.InitializeDelayed(new object[] { num, objArray3 });
     }
 }
Esempio n. 8
0
 public Window2Record(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
 {
     this.window2Options = (WorksheetWindowOptions)br.ReadUInt16();
     this.firstRow       = br.ReadUInt16();
     this.firstColumn    = br.ReadUInt16();
     if (bodyLength == 18)
     {
         this.smallRecord = false;
         br.ReadUInt16();
         br.ReadUInt16();
         this.pageBreakViewZoom = br.ReadUInt16();
         this.zoom = br.ReadUInt16();
         br.ReadUInt32();
     }
     else
     {
         if (bodyLength != 10)
         {
             throw new Exception("Internal error: Window2 record of size " + this.BodySize);
         }
         this.smallRecord = true;
         br.ReadUInt32();
     }
 }
Esempio n. 9
0
 public BoundSheetRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
     : base(staticDescriptor, bodyLength, br)
 {
     this.SheetName = (ExcelShortString)base.GetArguments()[3];
 }
Esempio n. 10
0
 public RowRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(bodyLength, br, previousRecord, operationInfo)
 {
 }
Esempio n. 11
0
 public ByteArrRec(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
 {
     this.data = br.ReadBytes(this.GetDescriptor().BodySize);
 }
Esempio n. 12
0
 public MsoBitmapPictureRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br, MsoType.Bitmap, operationInfo)
 {
     this.loadedFromExcel = true;
     base.Instance        = 1760;
 }
Esempio n. 13
0
 public IndexRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.FirstRow       = -1;
     this.LastRowPlusOne = -1;
     this.DBCells        = new ArrayList();
 }
Esempio n. 14
0
 public DBCellRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
     : base(staticDescriptor, bodyLength, br)
 {
     this.StartingCellsForRows = new ArrayList();
 }
Esempio n. 15
0
 public PaletteRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
 }
Esempio n. 16
0
 public int Add(AbsXLSRec record)
 {
     return(this.records.Add(record));
 }
Esempio n. 17
0
 public MsoDrawingRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.arguments = base.GetArguments();
     this.Parent    = this.arguments[0] as MsoContainerRecord;
 }
Esempio n. 18
0
 public ObjRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.items = new ArrayList();
 }
Esempio n. 19
0
 public MsoDrawingGroupRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
     this.continueTotalSize = 0;
     this.Read(bodyLength, br);
 }
Esempio n. 20
0
 public RKRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo)
 {
     this.Header = new CellRecordHeader(br);
     this.Val    = br.ReadUInt32();
 }
Esempio n. 21
0
 public HorizontalPageBreaksRecord(int bodyLength, BinaryReader br, AbsXLSRec previousRecord, IoOperationInfo operationInfo) : base(staticDescriptor, bodyLength, br)
 {
 }