Parse() public method

TODO : Documentation
public Parse ( Stream source ) : void
source Stream
return void
Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        public void Parse(Stream input)
        {
            BinaryReader br = new BinaryReader(input);

            _FrameSize = new Rect(this.Version);
            _FrameSize.Parse(input);

            _FrameRateDelay = br.ReadUInt16();
            _FrameRate = (_FrameRateDelay >> 8) + ((_FrameRateDelay & 0xFF) / 100);
            _FrameCount = br.ReadUInt16();

            int x = Math.Abs((this._FrameSize.Xmax - this._FrameSize.Xmin) / 12);
            int y = Math.Abs((this._FrameSize.Ymax - this._FrameSize.Ymin) / 12);

            if (x > SwfFile.Configuration.MaximumStageSizeX)
            {
                Log.Warn(this, "The x value(" + x + ") of the stage exceeds the allowed maximum.");
            }

            if (x < SwfFile.Configuration.MinimumStageSizeX)
            {
                Log.Warn(this, "The x value(" + x + ") of the stage under-runs the allowed minimum.");
            }

            if (y > SwfFile.Configuration.MaximumStageSizeY)
            {
                Log.Warn(this, "The y value(" + y + ") of the stage exceeds the allowed maximum.");
            }
            if (y < SwfFile.Configuration.MinimumStageSizeY)
            {
                Log.Warn(this, "The y value(" + y + ") of the stage under-runs the allowed minimum.");
            }
        }