Recurity.Swf.TagHandler.DefineButton.Parse C# (CSharp) Method

Parse() protected method

Parses this object out of a stream
protected Parse ( ) : void
return void
        protected override void Parse()
        {
            // TODO: Completely Untested!!!
            long initialPosition = this._dataStream.Position;

            BinaryReader2 br = new BinaryReader2(this._dataStream );

            this._buttonID = br.ReadUInt16();

            while ( 0 != br.PeekByte() )
            {
                ButtonRecord buttonR = new ButtonRecord( this.Version );
                buttonR.Parse( this._dataStream );
                if ( buttonR._ButtonHasBlendMode && ( this.Version < 8 ) )
                {
                    throw new SwfFormatException( "DefineButton with ButtonHasBlendMode requires Swf 8 (file: " + this.Version.ToString( "d" ) );
                }
                if ( buttonR._ButtonHasFilterList && ( this.Version < 8 ) )
                {
                    throw new SwfFormatException( "DefineButton with ButtonHasFilterList requires Swf 8 (file: " + this.Version.ToString( "d" ) );
                }
               this._characters.Add( buttonR );
            }
            // read the CharacterEndFlag
            br.ReadByte();

            //
            // Now read the ActionRecords that might be there
            //
            ParseCode(this._tag.Length - (uint)(this._dataStream.Position - initialPosition ) );

            if (this._dataStream.Position != this._dataStream.Length )
            {
                Log.Warn(this,  "Trailing garbage within DefineButton: " + this._dataStream.Position.ToString( "d" ) + " of " + this._dataStream.Length.ToString( "d" ) + " bytes used." );
            }
        }