コード例 #1
0
ファイル: SymbolClassTag.cs プロジェクト: Berenold/SwfExport
        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            if (version < 5)
            {
                return;
            }

            MemoryStream         m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            RecordHeader rh = new RecordHeader(TagCode, GetSizeOf());

            rh.WriteTo(w);

            if (exportedCharacters != null)
            {
                w.Write((ushort)exportedCharacters.Count);
            }
            else
            {
                w.Write((ushort)0);
            }

            if (exportedCharacters != null)
            {
                IEnumerator assertEnu = exportedCharacters.GetEnumerator();
                while (assertEnu.MoveNext())
                {
                    Assert assert = (Assert)assertEnu.Current;
                    assert.WriteTo(w);
                }
            }

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }
コード例 #2
0
        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            if (version < 5)
            {
                return;
            }

            MemoryStream         m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            int lenght = 2 + url.Length;

            if (exportedCharacters != null)
            {
                lenght += Assert.GetSizeOf(exportedCharacters);
            }

            RecordHeader rh = new RecordHeader(TagCode, lenght);

            rh.WriteTo(w);

            w.Write(url);
            w.Write((ushort)exportedCharacters.Count);

            IEnumerator asserts = exportedCharacters.GetEnumerator();

            while (asserts.MoveNext())
            {
                Assert assert = (Assert)asserts.Current;
                assert.WriteTo(w);
            }

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }