Class FlowDocumentTableExtensions
Fluent type extensions for manipulating FlowDocument objects focused on table creation.
Inherited Members
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.Wpf.FlowDocumentExtensions.dll
Syntax
public static class FlowDocumentTableExtensions
Methods
| Edit this page View SourceAdd(TableCellCollection, string)
Adds a new cell with the specified textual content.
Declaration
public static TableCell Add(this TableCellCollection cells, string content)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCellCollection | cells | Collection of cells in which to add a new cell with the specified content. |
| string | content | Textual content to include in the cell. |
Returns
| Type | Description |
|---|---|
| TableCell | A reference to the newly created cell. |
Add(TableCellCollection, Inline)
Adds a new cell with the specified content.
Declaration
public static TableCell Add(this TableCellCollection cells, Inline content)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCellCollection | cells | Collection of cells in which to add a new cell with the specified content. |
| Inline | content | Content to include in the cell. |
Returns
| Type | Description |
|---|---|
| TableCell | A reference to the newly created cell. |
AddCell(TableRow)
Adds an empty table cell to the current row.
Declaration
public static TableCell AddCell(this TableRow row)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | row | Table row to which the cell will be added. |
Returns
| Type | Description |
|---|---|
| TableCell | The cell that has been added. |
AddCell(TableRow, int)
Adds an empty table cell to the current row.
Declaration
public static TableCell AddCell(this TableRow row, int columnSpan)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | row | Table row to which the cell will be added. |
| int | columnSpan | Number of columns that the new cell can occupy. |
Returns
| Type | Description |
|---|---|
| TableCell | The cell that has been added. |
AddCell(TableRow, int, int)
Adds an empty table cell to the current row.
Declaration
public static TableCell AddCell(this TableRow row, int rowSpan, int columnSpan)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | row | Table row to which the cell will be added. |
| int | rowSpan | Number of rows that the new cell can occupy. |
| int | columnSpan | Number of columns that the new cell can occupy. |
Returns
| Type | Description |
|---|---|
| TableCell | The cell that has been added. |
AddCell(TableRow, string)
Adds a simple cell with text to a row.
Declaration
public static TableCell AddCell(this TableRow row, string text)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | row | Row to which to add the new cell. |
| string | text | Text of the cell. |
Returns
| Type | Description |
|---|---|
| TableCell |
|
AddCell(TableRow, string, FontWeight)
Adds a simple cell with text to a row.
Declaration
public static TableCell AddCell(this TableRow row, string text, FontWeight weight)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | row | Row to which to add the new cell. |
| string | text | Text of the cell. |
| FontWeight | weight | Font weight to use within the cell. |
Returns
| Type | Description |
|---|---|
| TableCell |
|
AddCell(TableRow, string, TextAlignment)
Adds a simple cell with text to a row.
Declaration
public static TableCell AddCell(this TableRow row, string text, TextAlignment alignment)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | row | Row to which to add the new cell. |
| string | text | Text of the cell. |
| TextAlignment | alignment | Horizontal text alignment within the cell. |
Returns
| Type | Description |
|---|---|
| TableCell |
|
AddCell(TableRow, string, TextAlignment, FontWeight)
Adds a simple cell with text to a row.
Declaration
public static TableCell AddCell(this TableRow row, string text, TextAlignment alignment, FontWeight weight)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | row | Row to which to add the new cell. |
| string | text | Text of the cell. |
| TextAlignment | alignment | Horizontal text alignment within the cell. |
| FontWeight | weight | Font weight to use within the cell. |
Returns
| Type | Description |
|---|---|
| TableCell |
|
AddGroup(Table)
Adds a new row group to the table.
Declaration
public static TableRowGroup AddGroup(this Table table)
Parameters
| Type | Name | Description |
|---|---|---|
| Table | table | Table to which to add the new row group. |
Returns
| Type | Description |
|---|---|
| TableRowGroup | The new row group that has been added to the table. |
AddGroup(Table, TableRowGroup)
Adds a new row group to the table.
Declaration
public static TableRowGroup AddGroup(this Table table, TableRowGroup newGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| Table | table | Table to which to add the new row group. |
| TableRowGroup | newGroup | New instance of the row group to add to the table. |
Returns
| Type | Description |
|---|---|
| TableRowGroup |
|
AddRow(Table, IEnumerable<string>)
Adds a new row to the table.
Declaration
public static TableRow AddRow(this Table tbl, IEnumerable<string> values)
Parameters
| Type | Name | Description |
|---|---|---|
| Table | tbl | The table to which the new row will be added. |
| IEnumerable<string> | values | Values to add to the row. |
Returns
| Type | Description |
|---|---|
| TableRow | A reference to the newly created row within a new group of rows in the table. |
AddRow(TableRowGroup)
Adds a new row to the row group.
Declaration
public static TableRow AddRow(this TableRowGroup group)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | group | Row group to which to add the new row. |
Returns
| Type | Description |
|---|---|
| TableRow | A reference to the new row created within the row group of the table. |
AddRow(TableRowGroup, IEnumerable<string>)
Adds a new row to the row group.
Declaration
public static TableRowGroup AddRow(this TableRowGroup rg, IEnumerable<string> values)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | rg | Row group to which to add the new row. |
| IEnumerable<string> | values | Values to add to the row. |
Returns
| Type | Description |
|---|---|
| TableRowGroup | A reference to the new row created within the row group of the table. |
AddRow(TableRowGroup, IEnumerable<Block>)
Adds a new row to the row group.
Declaration
public static TableRowGroup AddRow(this TableRowGroup rg, IEnumerable<Block> values)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | rg | The row group to which the new row will be added. |
| IEnumerable<Block> | values | Values to add to the row. |
Returns
| Type | Description |
|---|---|
| TableRowGroup | A reference to the newly created row within the row group of the table. |
AddRow(TableRowGroup, IEnumerable<TableCell>)
Adds a new row to the row group.
Declaration
public static TableRowGroup AddRow(this TableRowGroup rg, IEnumerable<TableCell> cells)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | rg | The row group to which the new row will be added. |
| IEnumerable<TableCell> | cells | Cells to add to the row. |
Returns
| Type | Description |
|---|---|
| TableRowGroup | A reference to the newly created row within the row group of the table. |
AddRow(TableRowGroup, params string[])
Adds a new row to the row group.
Declaration
public static TableRowGroup AddRow(this TableRowGroup rg, params string[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | rg | The row group to which the new row will be added. |
| string[] | values | Values to add to the row. |
Returns
| Type | Description |
|---|---|
| TableRowGroup | A reference to the newly created row within the row group of the table. |
AddRow(TableRowGroup, params Block[])
Adds a new row to the row group.
Declaration
public static TableRowGroup AddRow(this TableRowGroup rg, params Block[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | rg | The row group to which the new row will be added. |
| Block[] | values | Values to add to the row. |
Returns
| Type | Description |
|---|---|
| TableRowGroup | A reference to the newly created row within the row group of the table. |
AddRow(TableRowGroup, params TableCell[])
Adds a new row to the row group.
Declaration
public static TableRowGroup AddRow(this TableRowGroup rg, params TableCell[] cells)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | rg | The row group to which the new row will be added. |
| TableCell[] | cells | Cells to add to the row. |
Returns
| Type | Description |
|---|---|
| TableRowGroup | A reference to the newly created row within the row group of the table. |
ApplyStyle(TableCell, ICellStyle?)
Applies a style to a cell.
Declaration
public static TableCell ApplyStyle(this TableCell cell, ICellStyle? style)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCell | cell | Cell to style. |
| ICellStyle | style | Style to apply to the cell. |
Returns
| Type | Description |
|---|---|
| TableCell |
|
ApplyStyle(TableCell, ICellStyle?, bool)
Applies a style to a cell.
Declaration
public static TableCell ApplyStyle(this TableCell cell, ICellStyle? style, bool odd)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCell | cell | Cell to style. |
| ICellStyle | style | Style to apply to the cell. |
| bool | odd | Flag indicating whether it is an odd row or not. |
Returns
| Type | Description |
|---|---|
| TableCell |
|
Border(TableCell, Brush, Thickness)
Sets a border for a table cell.
Declaration
public static TableCell Border(this TableCell element, Brush brush, Thickness thickness)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCell | element | Cell to process. |
| Brush | brush | Brush to use for drawing the border. |
| Thickness | thickness | Thickness of the border. |
Returns
| Type | Description |
|---|---|
| TableCell |
|
Borders(TableRow, Brush, Thickness)
Sets a border for all cells in a TableRow.
Declaration
public static TableRow Borders(this TableRow element, Brush brush, Thickness thickness)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | element | TableRow to process. |
| Brush | brush | Brush to use for drawing the border. |
| Thickness | thickness | Thickness of the border. |
Returns
| Type | Description |
|---|---|
| TableRow |
|
Borders(TableRowGroup, Brush, Thickness)
Sets a border for all cells in a TableRowGroup.
Declaration
public static TableRowGroup Borders(this TableRowGroup element, Brush brush, Thickness thickness)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | element | TableRowGroup to process. |
| Brush | brush | Brush to use for drawing the border. |
| Thickness | thickness | Thickness of the border. |
Returns
| Type | Description |
|---|---|
| TableRowGroup |
|
CenterAll(TableRow)
Centers all content blocks in a row.
Declaration
public static TableRow CenterAll(this TableRow row)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | row | The row to which the operation should be applied. |
Returns
| Type | Description |
|---|---|
| TableRow |
|
CenterAll(TableRowGroup)
Centers all content blocks in a row group.
Declaration
public static TableRowGroup CenterAll(this TableRowGroup rowGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | rowGroup | The row group to which the operation should be applied. |
Returns
| Type | Description |
|---|---|
| TableRowGroup |
|
ColumnBackground(Table, int, Brush)
Sets a background color for the specified column of the table.
Declaration
public static Table ColumnBackground(this Table table, int column, Brush brush)
Parameters
| Type | Name | Description |
|---|---|---|
| Table | table | Table to process. |
| int | column | Index of the column. |
| Brush | brush | Brush to apply when drawing the table. |
Returns
| Type | Description |
|---|---|
| Table |
|
ColumnSpan(TableCell, int)
Sets a column span value for the specified cell.
Declaration
public static TableCell ColumnSpan(this TableCell cell, int span)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCell | cell | Cell to span. |
| int | span | Number of columns that the cell spans. |
Returns
| Type | Description |
|---|---|
| TableCell |
|
ColumnWidth(Table, int, GridLength)
Sets the width of a column for a Table.
Declaration
public static Table ColumnWidth(this Table table, int column, GridLength width)
Parameters
| Type | Name | Description |
|---|---|---|
| Table | table | Table to process. |
| int | column | Index of the column. |
| GridLength | width | Column width to apply. |
Returns
| Type | Description |
|---|---|
| Table |
|
ColumnWidths(Table, IEnumerable<double>)
Sets the column widths for a Table.
Declaration
public static Table ColumnWidths(this Table table, IEnumerable<double> lengths)
Parameters
| Type | Name | Description |
|---|---|---|
| Table | table | Table to process. |
| IEnumerable<double> | lengths | Column widths to apply. |
Returns
| Type | Description |
|---|---|
| Table |
|
ColumnWidths(Table, IEnumerable<GridLength>)
Sets the column widths for a Table.
Declaration
public static Table ColumnWidths(this Table table, IEnumerable<GridLength> lengths)
Parameters
| Type | Name | Description |
|---|---|---|
| Table | table | Table to process. |
| IEnumerable<GridLength> | lengths | Column widths to apply. |
Returns
| Type | Description |
|---|---|
| Table |
|
Done(TableCell)
Marks the end of the context of a cell, returning to its parent row in a way that is compatible with Fluent syntax.
Declaration
public static TableRow Done(this TableCell cell)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCell | cell | Cell for which to end the Fluent syntax context. |
Returns
| Type | Description |
|---|---|
| TableRow | The row to which this cell belongs. |
Done(TableRow)
Marks the end of the context of a table row, returning to its parent group in a way that is compatible with Fluent syntax.
Declaration
public static TableRowGroup Done(this TableRow row)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRow | row | Row for which to end the Fluent syntax context. |
Returns
| Type | Description |
|---|---|
| TableRowGroup | The row group to which this row belongs. |
Done(TableRowGroup)
Marks the end of the context of a table row group, returning to its parent table in a way that is compatible with Fluent syntax.
Declaration
public static Table Done(this TableRowGroup rowGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowGroup | rowGroup | Row group for which to end the Fluent syntax context. |
Returns
| Type | Description |
|---|---|
| Table | The table to which this row group belongs. |
RowSpan(TableCell, int)
Indicates that a cell occupies a specified number of rows.
Declaration
public static TableCell RowSpan(this TableCell cell, int span)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCell | cell | Cell to process. |
| int | span | Number of rows that this cell should occupy. |
Returns
| Type | Description |
|---|---|
| TableCell |
|
Text(TableCell, string)
Sets the content of the cell to the specified text.
Declaration
public static Paragraph Text(this TableCell cell, string text)
Parameters
| Type | Name | Description |
|---|---|---|
| TableCell | cell | Cell to process. |
| string | text | Text of the cell. |
Returns
| Type | Description |
|---|---|
| Paragraph | A Paragraph element that represents the textual content of the cell. |