private void DumpRef(XmlWriter writer, int id) { writer.WriteStartElement("ref"); writer.WriteAttributeString("id", id.ToString()); if (Swf != null) { var rc = Swf.GetCharacter(id); if (rc != null) { if (!string.IsNullOrEmpty(rc.Name)) { writer.WriteAttributeString("name", rc.Name); } writer.WriteAttributeString("code", rc.TagCode.ToString()); } } writer.WriteEndElement(); }
private static void DumpAsset(TextWriter writer, SwfMovie swf, SwfAsset asset) { var tag = asset.Character as SwfTag; if (tag != null) { writer.WriteLine("[{0}] {1} - {2}", asset.Id, asset.Name, tag.TagCode); var refs = tag.GetRefs(); if (refs != null && refs.Length > 0) { foreach (int rid in refs) { var rc = swf.GetCharacter((ushort)rid); if (rc != null) { if (string.IsNullOrEmpty(rc.Name)) { writer.WriteLine("\t{0}[{1}]", rc.TagCode, rid); } else { writer.WriteLine("\t{0}[{1}]", rc.Name, rid); } } else { writer.Write("\tnull[{0}]", rid); } } } } else { writer.WriteLine("[{0}] {1}", asset.Id, asset.Name); } }