private void SaveMsoDrawing(AbsXLSRecords records, MsoContainerRecord dgContainer) { XLSRecord record; MsoDelayedRecords delayedRecords = new MsoDelayedRecords { Offset = 8 }; byte[] sourceArray = dgContainer.ConvertToBytes(delayedRecords); sourceArray[0] = 15; int sourceIndex = 0; if (delayedRecords.Lengths.Count > 0) { int num2 = 0; int count = delayedRecords.Lengths.Count; while (num2 < count) { int num4 = (int)delayedRecords.Lengths[num2]; ArrayList list = (ArrayList)delayedRecords.DelayedRecords[num2]; int length = num4 - sourceIndex; byte[] destinationArray = new byte[length]; Array.Copy(sourceArray, sourceIndex, destinationArray, 0, length); new OptimizedBuffer(); if (num4 > 8224) { MemoryStream input = new MemoryStream(); input.Write(BitConverter.GetBytes((ushort)length), 0, 2); input.Write(destinationArray, 2, destinationArray.Length); input.Position = 0L; record = new XLSRecord(60, destinationArray.Length + 2, new BinaryReader(input)); input.Close(); } else { record = new MsoDrawingRecord(); (record as MsoDrawingRecord).Data = destinationArray; } sourceIndex = num4; records.Add(record); for (int i = 0; i < list.Count; i++) { XLSRecord record2 = (XLSRecord)list[i]; records.Add(record2); } num2++; } } else { record = new MsoDrawingRecord(); (record as MsoDrawingRecord).Data = sourceArray; records.Add(record); } }
private void SaveNotes(AbsXLSRecords records) { for (int i = 0; i < this.notes.Count; i++) { NoteRecord record = (NoteRecord)this.notes[i]; records.Add(record); } }
public void WriteRecords(AbsXLSRecords destination, int recordCode) { ArrayList list = (ArrayList)this.typeGroupedRecords[recordCode]; if (list != null) { foreach (XLSRecord record in list) { destination.Add(record); } } }