Esempio n. 1
0
    /// <summary>
    /// Render a Row to RTF.
    /// </summary>
    internal override void Render()
    {
      this.useEffectiveValue = true;
      this.rtfWriter.WriteControl("trowd");
      new RowsRenderer(DocumentRelations.GetParent(this.row) as Rows, this.docRenderer).Render();
      RenderRowHeight();
      //MigraDoc always keeps together table rows.
      this.rtfWriter.WriteControl("trkeep");
      Translate("HeadingFormat", "trhdr");

      // trkeepfollow is intended to keep table rows together.
      // Unfortunalte, this does not work in word.
      int thisRowIdx = this.row.Index;
      for (int rowIdx = 0; rowIdx <= this.row.Index; ++rowIdx)
      {
        object keepWith = this.row.Table.Rows[rowIdx].GetValue("KeepWith");
        if (keepWith != null && (int)keepWith + rowIdx > thisRowIdx)
          this.rtfWriter.WriteControl("trkeepfollow");
      }
      RenderTopBottomPadding();

      //Cell borders etc. are written before the contents.
      for (int idx = 0; idx < this.row.Table.Columns.Count; ++idx)
      {
        Cell cell = this.row.Cells[idx];
        CellFormatRenderer cellFrmtRenderer =
        new CellFormatRenderer(cell, this.docRenderer);
        cellFrmtRenderer.CellList = this.cellList;
        cellFrmtRenderer.Render();
      }
      foreach (Cell cell in this.row.Cells)
      {
        CellRenderer cellRndrr = new CellRenderer(cell, this.docRenderer);
        cellRndrr.CellList = this.cellList;
        cellRndrr.Render();
      }

      this.rtfWriter.WriteControl("row");
    }