Beispiel #1
0
 public override byte[] ConvertToBytes(MsoDelayedRecords delayedRecords)
 {
     byte[] buffer = base.ConvertToBytes(delayedRecords);
     delayedRecords.DelayedRecords.Add(this.items);
     delayedRecords.Lengths.Add(delayedRecords.Offset);
     return(buffer);
 }
Beispiel #2
0
        protected override byte[] SetData(MsoDelayedRecords delayedRecords)
        {
            OptimizedBuffer buffer = new OptimizedBuffer();

            byte[] bytes = this.Picture.ConvertToBytes(delayedRecords);
            if ((base.Instance == 5) && this.Picture.LoadedFromExcel)
            {
                base.Instance = 6;
            }
            buffer.Write(this.requiredWin, 0);
            byte data = 0;

            for (int i = 0; i < 19; i++)
            {
                buffer.Write(data, 1 + i);
            }
            buffer.Write((uint)bytes.Length, 20);
            buffer.Write(1, 24);
            for (int j = 0; j < 8; j++)
            {
                buffer.Write(data, 28 + j);
            }
            buffer.Write(bytes, 36, 0, bytes.Length);
            return(buffer.Buffer);
        }
Beispiel #3
0
 protected override byte[] SetData(MsoDelayedRecords delayedRecords)
 {
     byte[] buffer = new byte[8];
     BitConverter.GetBytes(this.shapesNumber).CopyTo(buffer, 0);
     BitConverter.GetBytes(this.lastId).CopyTo(buffer, 4);
     return(buffer);
 }
Beispiel #4
0
 protected override byte[] SetData(MsoDelayedRecords delayedRecords)
 {
     byte[] bytes = new byte[this.properties.Count * 6];
     base.atom = 51;
     this.SetInstance();
     this.SetDataFromProperties(bytes);
     return(bytes);
 }
Beispiel #5
0
 protected override byte[] SetData(MsoDelayedRecords delayedRecords)
 {
     byte[] buffer = new byte[16];
     BitConverter.GetBytes(0).CopyTo(buffer, 0);
     BitConverter.GetBytes(0).CopyTo(buffer, 4);
     BitConverter.GetBytes(0).CopyTo(buffer, 8);
     BitConverter.GetBytes(0).CopyTo(buffer, 12);
     return(buffer);
 }
Beispiel #6
0
 protected override byte[] SetData(MsoDelayedRecords delayedRecords)
 {
     byte[] buffer = new byte[8];
     BitConverter.GetBytes(this.shapeId).CopyTo(buffer, 0);
     buffer[4] = (byte)(this.isTopMost ? 4 : 0);
     buffer[5] = 10;
     buffer[6] = 0;
     buffer[7] = 0;
     return(buffer);
 }
Beispiel #7
0
 protected override byte[] SetData(MsoDelayedRecords delayedRecords)
 {
     byte[] array = new byte[18];
     BitConverter.GetBytes((ushort)0).CopyTo(array, 0);
     BitConverter.GetBytes(this.left).CopyTo(array, 2);
     BitConverter.GetBytes(this.top).CopyTo(array, 6);
     BitConverter.GetBytes(this.right).CopyTo(array, 10);
     BitConverter.GetBytes(this.bottom).CopyTo(array, 14);
     return(array);
 }
Beispiel #8
0
        public override byte[] ConvertToBytes(MsoDelayedRecords delayedRecords)
        {
            byte[]    buffer = base.ConvertToBytes(delayedRecords);
            ArrayList list   = new ArrayList();

            list.AddRange(new XLSRecord[] { this.TextObject, this.TextContinue, this.FormattingRuns });
            delayedRecords.DelayedRecords.Add(list);
            delayedRecords.Lengths.Add(delayedRecords.Offset);
            return(buffer);
        }
Beispiel #9
0
        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);
            }
        }
Beispiel #10
0
        public virtual byte[] ConvertToBytes(MsoDelayedRecords delayedRecords)
        {
            OptimizedBuffer buffer = new OptimizedBuffer();

            byte[] bytes = this.SetData(delayedRecords);
            buffer.Write(this.atom, 0);
            buffer.Write(this.type, 2);
            buffer.Write(bytes.Length, 4);
            buffer.Write(bytes, 8, 0, bytes.Length);
            return(buffer.Buffer);
        }
Beispiel #11
0
 private void SetBody()
 {
     if (this.cashedData == null)
     {
         MsoDelayedRecords delayedRecords = new MsoDelayedRecords();
         byte[]            bytesWithoutContinueRecords = this.parent.ConvertToBytes(delayedRecords);
         if (bytesWithoutContinueRecords.Length < 8224)
         {
             this.cashedData = bytesWithoutContinueRecords;
         }
         else
         {
             this.SetBodyWithContinueRecords(bytesWithoutContinueRecords.Length, bytesWithoutContinueRecords);
         }
     }
 }
Beispiel #12
0
        protected override byte[] SetData(MsoDelayedRecords delayedRecords)
        {
            OptimizedBuffer buffer = new OptimizedBuffer();
            int             length = 0;
            int             offset = 0;
            int             num3   = delayedRecords.Offset;

            for (int i = 0; i < this.items.Count; i++)
            {
                delayedRecords.Offset = (num3 + offset) + 8;
                byte[] bytes = (this.items[i] as MsoBaseRecord).ConvertToBytes(delayedRecords);
                buffer.Write(bytes, offset, 0, bytes.Length);
                length  = bytes.Length;
                offset += length;
            }
            return(buffer.Buffer);
        }
Beispiel #13
0
        protected override byte[] SetData(MsoDelayedRecords delayedRecords)
        {
            OptimizedBuffer buffer = new OptimizedBuffer();

            buffer.Write(1024, 0);
            buffer.Write(this.clustersCount, 4);
            buffer.Write(this.shapesCount, 8);
            buffer.Write(this.drawingsCount, 12);
            int offset = 12;

            for (int i = 0; i < this.clusters.Count; i++)
            {
                byte[] bytes = ((ClusterID)this.clusters[i]).ConvertToBytes();
                buffer.Write(bytes, offset, 0, bytes.Length);
                offset += bytes.Length;
            }
            return(buffer.Buffer);
        }
Beispiel #14
0
        protected override byte[] SetData(MsoDelayedRecords delayedRecords)
        {
            int             length;
            OptimizedBuffer buffer = new OptimizedBuffer();

            if (this.Image != null)
            {
                MemoryStream stream   = new MemoryStream();
                MsoBlipType  blipType = (base.Parent as MsofbtBseRecord).BlipType;
                this.Image.Save(stream, ConvertBlipTypeToImageFormat(blipType));
                this.ImageBytes = stream.GetBuffer();
                length          = (int)stream.Length;
            }
            else
            {
                length = this.ImageBytes.Length;
            }
            byte[] bytes = new MD5CryptoServiceProvider().ComputeHash(this.imageBytes);
            buffer.Write(bytes, 0, 0, bytes.Length);
            buffer.Write(0, bytes.Length);
            buffer.Write(this.imageBytes, bytes.Length + 1, 0, length);
            return(buffer.Buffer);
        }
Beispiel #15
0
 protected override byte[] SetData(MsoDelayedRecords delayedRecords)
 {
     return(new byte[0]);
 }
Beispiel #16
0
 protected override byte[] SetData(MsoDelayedRecords delayedRecords)
 {
     return(this.bytes.Buffer);
 }
Beispiel #17
0
 protected abstract byte[] SetData(MsoDelayedRecords delayedRecords);