// // // void TagToWarningLog(SwfTagBase tag) { if (WarningLog != null) { WarningLog(string.Format("SwfContextExecuter: {0}", tag)); } }
// // // void TagToWarningLog(SwfTagBase tag) { if (WarningLog != null) { WarningLog(string.Format("{0}", tag)); } }
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)); }
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); }
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() }); }
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); }
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"); } } }
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)); }
private XElement BuildTagXml(SwfTagBase tag) { var formatter = _formatterFactory.GetFormatter(tag); return formatter.FormatTag(tag); }
XElement ITagFormatter.FormatTag(SwfTagBase tag) { return(FormatTag((T)tag)); }
SwfTagBase ITagFormatter.ParseTo(XElement xTag, SwfTagBase tag) { return(ParseTo(xTag, (T)tag)); }
private XElement BuildTagXml(SwfTagBase tag) { var formatter = _formatterFactory.GetFormatter(tag); return(formatter.FormatTag(tag)); }
protected byte[] SerializeTag(SwfFile file, SwfTagBase tag) { var tagData = new SwfTagSerializer(file).GetTagData(tag); return(tagData.Data); }