//
        //
        //

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

        void TagToWarningLog(SwfTagBase tag)
        {
            if (WarningLog != null)
            {
                WarningLog(string.Format("{0}", tag));
            }
        }
示例#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));
        }
示例#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);
        }
示例#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()
            });
        }
示例#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);
        }
示例#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");
         }
     }
 }
示例#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);
     }
 }
示例#9
0
        protected XElement BuildTagXml(SwfTagBase tag)
        {
            var subFormatter = _subFormatterFactory.GetFormatter(tag);

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

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

            return(tagData.Data);
        }