Beispiel #1
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 #2
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()
            });
        }