示例#1
0
        public override Position Draft(Rectangle bounds)
        {
            if (!_staticConditionsSatisfied)
            {
                return(bounds.BottomLeft);
            }

            using (new TraceContextPusher(_generator, _traceContext))
            {
                Trace("start bounds={0}", bounds);

                //	Pad with blank cells if necessary
                while (_photoRow.NumSubLayouts < _numCells)
                {
                    _photoRow.AddSubLayout(new TableCellLayout(_generator, _trackingInfo.LineNumber, _trackingInfo.LinePosition, null));
                    _captionRow.AddSubLayout(new TableCellLayout(_generator, _trackingInfo.LineNumber, _trackingInfo.LinePosition, null));
                }

                //	Remember the original bounds
                _bounds = new Rectangle(bounds);

                //	We don't apply padding to the table or to the row, because the table
                //	is just structural and isn't part of the designed layout. When we
                //	get down to the photo layout we'll apply padding there.

                Position pos = _photoRow.Draft(bounds);
                bounds.Bottom = pos.Y;
                bounds.Top    = bounds.Bottom;
                pos           = _captionRow.Draft(bounds);

                //	We can't call the base class implementation of Draft because that assumes
                //	the sublayouts are laid out vertically, but in the case of a photo row
                //	they're laid out horizontally
                _bounds.Bottom = pos.Y;
                HandleEmpty();
                Trace("end _bounds={0}", _bounds);
                return(_bounds.BottomLeft);
            }
        }