//
        //
        //

        void TagToWarningLog(SwfTagBase tag)
        {
            if (WarningLog != null)
            {
                WarningLog(string.Format("SwfContextExecuter: {0}", tag));
            }
        }
Beispiel #2
0
        //
        //
        //

        void TagToWarningLog(SwfTagBase tag)
        {
            if (WarningLog != null)
            {
                WarningLog(string.Format("{0}", tag));
            }
        }
Beispiel #3
0
        protected string GetTagHash(SwfTagBase tag)
        {
            var file = new SwfFile();

            file.FileInfo.Version = 10;
            var ser     = new SwfTagSerializer(file);
            var tagData = ser.GetTagData(tag);

            return(GetTagHash(tagData));
        }
Beispiel #4
0
        public ITagFormatter GetFormatter(SwfTagBase tag)
        {
            var           type = tag.TagType;
            ITagFormatter formatter;

            if (!_cache.TryGetValue(type, out formatter))
            {
                formatter    = tag.AcceptVistor(this, null);
                _cache[type] = formatter;
            }
            return(formatter);
        }
Beispiel #5
0
        public SwfTagData GetTagData(SwfTagBase tag)
        {
            var mem    = new MemoryStream();
            var writer = new SwfStreamWriter(mem);

            tag.AcceptVistor(this, writer);
            writer.FlushBits();
            if (tag.RestData != null && tag.RestData.Length > 0)
            {
                writer.WriteBytes(tag.RestData);
            }
            return(new SwfTagData {
                Type = tag.TagType, Data = mem.ToArray()
            });
        }
Beispiel #6
0
        public static SwfControlTags Read(SwfStreamReader reader)
        {
            var control_tags = SwfControlTags.identity;

            while (true)
            {
                var tag = SwfTagBase.Read(reader);
                if (tag.TagType == SwfTagType.End)
                {
                    break;
                }
                control_tags.Tags.Add(tag);
            }
            return(control_tags);
        }
Beispiel #7
0
 private static void ReadTags(SwfFile file, ISwfStreamReader reader)
 {
     while (!reader.IsEOF)
     {
         var        ser     = new SwfTagDeserializer(file);
         var        tagData = reader.ReadTagData();
         SwfTagBase tag     = ser.ReadTag(tagData);
         if (tag != null)
         {
             file.Tags.Add(tag);
         }
         else
         {
             throw new InvalidOperationException("Tag can't be null. Loss of data possible");
         }
     }
 }
Beispiel #8
0
 void DecodeSwf(SwfStreamReader reader, System.Action <float> progress_act)
 {
     UncompressedHeader = SwfLongHeader.Read(reader);
     while (!reader.IsEOF)
     {
         if (progress_act != null)
         {
             progress_act((float)(reader.Position + 1) / reader.Length);
         }
         var tag = SwfTagBase.Read(reader);
         if (tag.TagType == SwfTagType.End)
         {
             break;
         }
         Tags.Add(tag);
     }
 }
        protected XElement BuildTagXml(SwfTagBase tag)
        {
            var subFormatter = _subFormatterFactory.GetFormatter(tag);

            return(subFormatter.FormatTag(tag));
        }
Beispiel #10
0
 private XElement BuildTagXml(SwfTagBase tag)
 {
     var formatter = _formatterFactory.GetFormatter(tag);
     return formatter.FormatTag(tag);
 }
Beispiel #11
0
 XElement ITagFormatter.FormatTag(SwfTagBase tag)
 {
     return(FormatTag((T)tag));
 }
Beispiel #12
0
 SwfTagBase ITagFormatter.ParseTo(XElement xTag, SwfTagBase tag)
 {
     return(ParseTo(xTag, (T)tag));
 }
Beispiel #13
0
        private XElement BuildTagXml(SwfTagBase tag)
        {
            var formatter = _formatterFactory.GetFormatter(tag);

            return(formatter.FormatTag(tag));
        }
Beispiel #14
0
        protected byte[] SerializeTag(SwfFile file, SwfTagBase tag)
        {
            var tagData = new SwfTagSerializer(file).GetTagData(tag);

            return(tagData.Data);
        }