//----------------------------------------------------------------------------------------------------x
 /// <summary>This method will be called before the report objects will be written to the container.</summary>
 internal protected override void OnBeforeWrite()
 {
     for (Int32 iCol = 0; iCol < al_TlmColumn.Count; iCol++)
     {
         TlmCell cell = tlmRow_Committed.aTlmCell[iCol];
         if (cell.tlmColumn_Start.iIndex != iCol)
         {
             continue;
         }
         TlmColumn col = al_TlmColumn[iCol];
         if (!Double.IsNaN(col.rBorderBottom))
         {
             cell.rMarginBottom = col.rBorderBottom;
         }
         if (!Object.ReferenceEquals(col.penProp_BorderBottom, PenProp.penProp_Null))
         {
             cell.penProp_LineBottom = col.penProp_BorderBottom;
         }
     }
 }
示例#2
0
        //----------------------------------------------------------------------------------------------------x
        /// <summary>Creates a cell definition object.</summary>
        /// <param name="tlmColumn_Start">Start column</param>
        /// <param name="tlmColumn_End">End column</param>
        /// <param name="tlmRow">Start row</param>
        internal TlmCell(TlmColumn tlmColumn_Start, TlmColumn tlmColumn_End, TlmRow tlmRow)
        {
            this.tlmColumn_Start = tlmColumn_Start;
            this.tlmColumn_End   = tlmColumn_End;
            tlmRow_Start         = tlmRow;
            tlmRow_End           = tlmRow;

            TlmCellDef cd_Col  = tlmColumn_Start.tlmCellDef_Default;
            TlmCellDef cd_Base = tlmBase.tlmCellDef_Default;

            rAlignH     = (Double.IsNaN(cd_Col.rAlignH) ? cd_Base.rAlignH : cd_Col.rAlignH);
            rAlignV     = (Double.IsNaN(cd_Col.rAlignV) ? cd_Base.rAlignV : cd_Col.rAlignV);
            rAngle      = (Double.IsNaN(cd_Col.rAngle) ? cd_Base.rAngle : cd_Col.rAngle);
            tlmTextMode = (cd_Col.tlmTextMode == TlmTextMode.FallBack ? cd_Base.tlmTextMode : cd_Col.tlmTextMode);
            rLineFeed   = (Double.IsNaN(cd_Col.rLineFeed) ? cd_Base.rLineFeed : cd_Col.rLineFeed);

            rMarginLeft   = (Double.IsNaN(cd_Col.rMarginLeft) ? cd_Base.rMarginLeft : cd_Col.rMarginLeft);
            rMarginRight  = (Double.IsNaN(cd_Col.rMarginRight) ? cd_Base.rMarginRight : cd_Col.rMarginRight);
            rMarginTop    = (Double.IsNaN(cd_Col.rMarginTop) ? cd_Base.rMarginTop : cd_Col.rMarginTop);
            rMarginBottom = (Double.IsNaN(cd_Col.rMarginBottom) ? cd_Base.rMarginBottom : cd_Col.rMarginBottom);

            rIndentLeft   = (Double.IsNaN(cd_Col.rIndentLeft) ? cd_Base.rIndentLeft : cd_Col.rIndentLeft);
            rIndentRight  = (Double.IsNaN(cd_Col.rIndentRight) ? cd_Base.rIndentRight : cd_Col.rIndentRight);
            rIndentTop    = (Double.IsNaN(cd_Col.rIndentTop) ? cd_Base.rIndentTop : cd_Col.rIndentTop);
            rIndentBottom = (Double.IsNaN(cd_Col.rIndentBottom) ? cd_Base.rIndentBottom : cd_Col.rIndentBottom);

            brushProp_Back = (Object.ReferenceEquals(cd_Col.brushProp_Back, BrushProp.bp_Null) ? cd_Base.brushProp_Back : cd_Col.brushProp_Back);

            penProp_LineLeft   = (Object.ReferenceEquals(cd_Col.penProp_LineLeft, PenProp.penProp_Null) ? cd_Base.penProp_LineLeft : cd_Col.penProp_LineLeft);
            penProp_LineRight  = (Object.ReferenceEquals(cd_Col.penProp_LineRight, PenProp.penProp_Null) ? cd_Base.penProp_LineRight : cd_Col.penProp_LineRight);
            penProp_LineTop    = (Object.ReferenceEquals(cd_Col.penProp_LineTop, PenProp.penProp_Null) ? cd_Base.penProp_LineTop : cd_Col.penProp_LineTop);
            penProp_LineBottom = (Object.ReferenceEquals(cd_Col.penProp_LineBottom, PenProp.penProp_Null) ? cd_Base.penProp_LineBottom : cd_Col.penProp_LineBottom);

            iOrderLineLeft   = (cd_Col.iOrderLineLeft == Int32.MinValue ? cd_Base.iOrderLineLeft : cd_Col.iOrderLineLeft);
            iOrderLineRight  = (cd_Col.iOrderLineRight == Int32.MinValue ? cd_Base.iOrderLineRight : cd_Col.iOrderLineRight);
            iOrderLineTop    = (cd_Col.iOrderLineTop == Int32.MinValue ? cd_Base.iOrderLineTop : cd_Col.iOrderLineTop);
            iOrderLineBottom = (cd_Col.iOrderLineBottom == Int32.MinValue ? cd_Base.iOrderLineBottom : cd_Col.iOrderLineBottom);
        }
        //----------------------------------------------------------------------------------------------------x
        // Virtual Methods
        //----------------------------------------------------------------------------------------------------x

        //----------------------------------------------------------------------------------------------------x
        /// <summary>This method will be called before the row will be closed.</summary>
        /// <param name="row">Row that will be closed</param>
        internal protected override void OnClosingRow(TlmRow row)
        {
            if (row.iIndex != 1)
            {
                return;
            }
            for (Int32 iCol = 0; iCol < al_TlmColumn.Count; iCol++)
            {
                TlmCell cell = row.aTlmCell[iCol];
                if (cell.tlmColumn_Start.iIndex != iCol)
                {
                    continue;
                }
                TlmColumn col = al_TlmColumn[iCol];
                if (!Double.IsNaN(col.rBorderTop))
                {
                    cell.rMarginTop = col.rBorderTop;
                }
                if (!Object.ReferenceEquals(col.penProp_BorderTop, PenProp.penProp_Null))
                {
                    cell.penProp_LineTop = col.penProp_BorderTop;
                }
            }
        }
示例#4
0
 //----------------------------------------------------------------------------------------------------x
 /// <summary>Gets the cell of the specified column.</summary>
 /// <param name="col">Column</param>
 /// <value>Cell of the specified column</value>
 /// <include file='D:\Programs\DotNet03\Root\Reports\Include.xml' path='documentation/class[@name="TlmRowSample_ColumnIndexer"]/*'/>
 public TlmCell this[TlmColumn col] {
     get { return(aTlmCell[col.iIndex]); }
 }
示例#5
0
        //----------------------------------------------------------------------------------------------------x
        /// <summary>Creates a row definition object.</summary>
        /// <param name="tlmBase">Table layout manager of this row</param>
        /// <param name="tlmRow_Prev">The new row will be inserted after <paramref name="tlmRow_Prev"/> or at the beginning if it is <see langword="null"/>.</param>
        /// <param name="aCellCreateType">Array with the cell creation data for each column</param>
        /// <exception cref="ReportException">The row cannot be created.</exception>
        internal TlmRow(TlmBase tlmBase, TlmRow tlmRow_Prev, TlmBase.CellCreateType[] aCellCreateType) : this(tlmBase) {
            if (tlmBase.list_TlmColumn.Count != aCellCreateType.Length)
            {
                throw new ReportException("The length of the cell create type array must be equal to the number of coulmns that are defined for this table layout manager.");
            }

            for (Int32 iCol = 0; iCol < tlmBase.list_TlmColumn.Count; iCol++)
            {
                TlmColumn col = tlmBase.list_TlmColumn[iCol];
                switch (aCellCreateType[iCol])
                {
                case TlmBase.CellCreateType.New: {
                    aTlmCell.SetCell(iCol, new TlmCell(col, col, this));
                    break;
                }

                case TlmBase.CellCreateType.MergedV: {
                    if (tlmRow_Prev == null)
                    {
                        throw new ReportException("First row cannot be merged vertically.");
                    }
                    TlmCell cell_Prev = tlmRow_Prev.aTlmCell[iCol];
                    if (cell_Prev.tlmColumn_Start.iIndex != iCol)
                    {
                        throw new ReportException("Vertically merged cells must start in the same column.");
                    }
                    Debug.Assert(cell_Prev.tlmRow_End.iIndex == tlmRow_Prev.iIndex);
                    cell_Prev.tlmRow_End = this;
                    while (true)
                    {
                        aTlmCell.SetCell(iCol, cell_Prev);
                        if (iCol >= cell_Prev.tlmColumn_End.iIndex)
                        {
                            break;
                        }
                        iCol++;
                        if (aCellCreateType[iCol] != TlmBase.CellCreateType.MergedH)
                        {
                            throw new ReportException("Invalid cell create type of column " + iCol.ToString() + "; 'MergedH' expected");
                        }
                    }
                    break;
                }

                case TlmBase.CellCreateType.MergedH: {
                    if (iCol == 0)
                    {
                        throw new ReportException("First column cannot be merged horizonally.");
                    }
                    TlmCell cell_Left = aTlmCell[iCol - 1];
                    if (!Object.ReferenceEquals(cell_Left.tlmRow_Start, this))
                    {
                        throw new ReportException("Horizontally merged cells must start in the same row.");
                    }
                    aTlmCell.SetCell(iCol, cell_Left);
                    Debug.Assert(cell_Left.tlmColumn_End.iIndex + 1 == iCol);
                    cell_Left.tlmColumn_End = col;
                    break;
                }

                case TlmBase.CellCreateType.Empty: {
                    break;
                }

                default: {
                    Debug.Fail("unknown cell create type");
                    break;
                }
                }
            }
            tlmBase.InsertRow(tlmRow_Prev, this);

            tlmBase.OnNewRow(this);
        }