public override void Decode()
        {
            MemoryStream stream = new MemoryStream(Data);

            EscherRecords.Clear();
            while (stream.Position < stream.Length)
            {
                EscherRecord record = EscherRecord.Read(stream);
                record.Decode();
                EscherRecords.Add(record);
            }
        }
Example #2
0
        public override void Decode()
        {
            MemoryStream stream = new MemoryStream(Data);
            BinaryReader reader = new BinaryReader(stream);

            BlipTypeWin32 = reader.ReadByte();
            BlipTypeMacOS = reader.ReadByte();
            UID           = new Guid(reader.ReadBytes(16));
            Tag           = reader.ReadUInt16();
            BlipSize      = reader.ReadUInt32();
            Ref           = reader.ReadInt32();
            Offset        = reader.ReadInt32();
            Usage         = reader.ReadByte();
            NameLength    = reader.ReadByte();
            Unused2       = reader.ReadByte();
            Unused3       = reader.ReadByte();

            if (NameLength > 0)
            {
                BlipName = Encoding.Unicode.GetString(reader.ReadBytes(NameLength));
            }

            if (stream.Position < stream.Length)
            {
                BlipRecord = EscherRecord.Read(stream) as MsofbtBlip;
                if (BlipRecord != null)
                {
                    BlipRecord.Decode();
                    this.ImageData = BlipRecord.ImageData;
                }
                else
                {
                    throw new Exception("Image Type Not supported.");
                }
            }

            if (stream.Position < stream.Length)
            {
                ExtraData = StreamHelper.ReadToEnd(stream);
            }
        }