示例#1
0
        internal void Arrange(int du, int dv, PTS.FSRECT rcTable, FlowDirection tableFlowDirection, PageContext pageContext)
        {
            CalculatedColumn[] calculatedColumns   = this._tableParaClient.CalculatedColumns;
            double             internalCellSpacing = this.Table.InternalCellSpacing;
            double             num = -internalCellSpacing;
            int num2 = this.Cell.ColumnIndex + this.Cell.ColumnSpan - 1;

            do
            {
                num += calculatedColumns[num2].DurWidth + internalCellSpacing;
            }while (--num2 >= this.ColumnIndex);
            if (tableFlowDirection != base.PageFlowDirection)
            {
                PTS.FSRECT pageRect = pageContext.PageRect;
                PTS.Validate(PTS.FsTransformRectangle(PTS.FlowDirectionToFswdir(base.PageFlowDirection), ref pageRect, ref rcTable, PTS.FlowDirectionToFswdir(tableFlowDirection), out rcTable));
            }
            this._rect.u  = du + rcTable.u;
            this._rect.v  = dv + rcTable.v;
            this._rect.du = TextDpi.ToTextDpi(num);
            this._rect.dv = TextDpi.ToTextDpi(this._arrangeHeight);
            if (tableFlowDirection != base.PageFlowDirection)
            {
                PTS.FSRECT pageRect2 = pageContext.PageRect;
                PTS.Validate(PTS.FsTransformRectangle(PTS.FlowDirectionToFswdir(tableFlowDirection), ref pageRect2, ref this._rect, PTS.FlowDirectionToFswdir(base.PageFlowDirection), out this._rect));
            }
            this._flowDirectionParent = tableFlowDirection;
            this._flowDirection       = (FlowDirection)base.Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty);
            this._pageContext         = pageContext;
            this.OnArrange();
            if (this._paraHandle.Value != IntPtr.Zero)
            {
                PTS.Validate(PTS.FsClearUpdateInfoInSubpage(base.PtsContext.Context, this._paraHandle.Value), base.PtsContext);
            }
        }
        //------------------------------------------------------
        //
        //  Public Methods
        //
        //------------------------------------------------------

        #region Public Methods

        #endregion Public Methods

        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        #region Internal Methods

        /// <summary>
        /// Arrange.
        /// </summary>
        /// <param name="du">U offset component of the cell's visual.</param>
        /// <param name="dv">V offset component of the cell's visual.</param>
        /// <param name="rcTable">Table's rectangle.. (in page flow dir)</param>
        /// <param name="tableFlowDirection">Table's flow direction</param>
        /// <param name="pageContext">Page context</param>
        internal void Arrange(int du, int dv, PTS.FSRECT rcTable, FlowDirection tableFlowDirection, PageContext pageContext)
        {
            //
            // Determine cell width based on column widths.
            //
            CalculatedColumn[] calculatedColumns = _tableParaClient.CalculatedColumns;
            Debug.Assert(calculatedColumns != null &&
                         (Cell.ColumnIndex + Cell.ColumnSpan) <= calculatedColumns.Length);

            double durCellSpacing = Table.InternalCellSpacing;
            double durCellWidth   = -durCellSpacing;

            // find the width sum of all columns the cell spans
            int i = Cell.ColumnIndex + Cell.ColumnSpan - 1;

            do
            {
                durCellWidth += calculatedColumns[i].DurWidth + durCellSpacing;
            } while (--i >= ColumnIndex);

            if (tableFlowDirection != PageFlowDirection)
            {
                PTS.FSRECT pageRect = pageContext.PageRect;

                PTS.Validate(PTS.FsTransformRectangle(PTS.FlowDirectionToFswdir(PageFlowDirection), ref pageRect, ref rcTable, PTS.FlowDirectionToFswdir(tableFlowDirection), out rcTable));
            }

            _rect.u  = du + rcTable.u;
            _rect.v  = dv + rcTable.v;
            _rect.du = TextDpi.ToTextDpi(durCellWidth);
            _rect.dv = TextDpi.ToTextDpi(_arrangeHeight);

            if (tableFlowDirection != PageFlowDirection)
            {
                PTS.FSRECT pageRect = pageContext.PageRect;

                PTS.Validate(PTS.FsTransformRectangle(PTS.FlowDirectionToFswdir(tableFlowDirection), ref pageRect, ref _rect, PTS.FlowDirectionToFswdir(PageFlowDirection), out _rect));
            }

            _flowDirectionParent = tableFlowDirection;
            _flowDirection       = (FlowDirection)Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty);
            _pageContext         = pageContext;

            OnArrange();

            if (_paraHandle.Value != IntPtr.Zero)
            {
                PTS.Validate(PTS.FsClearUpdateInfoInSubpage(PtsContext.Context, _paraHandle.Value), PtsContext);
            }
        }