Struct GridPlacement
- Namespace
- SharpConsoleUI.Layout
- Assembly
- SharpConsoleUI.dll
Describes where a single cell sits within a grid: its starting row and column (both zero-based), how many rows and columns it spans, and its optional per-cell styling (background fill, border, and content padding).
public readonly record struct GridPlacement : IEquatable<GridPlacement>
- Implements
- Inherited Members
- Extension Methods
Constructors
GridPlacement(int, int, int, int)
Describes where a single cell sits within a grid: its starting row and column (both zero-based), how many rows and columns it spans, and its optional per-cell styling (background fill, border, and content padding).
public GridPlacement(int Row, int Col, int RowSpan = 1, int ColSpan = 1)
Parameters
RowintThe zero-based row index of the cell's top-left corner.
ColintThe zero-based column index of the cell's top-left corner.
RowSpanintThe number of rows the cell occupies. Defaults to 1.
ColSpanintThe number of columns the cell occupies. Defaults to 1.
Properties
Background
Gets the per-cell background fill colour. When null (the default), the cell paints no
background of its own and shows through to whatever is behind it (the grid background, or the
content underneath the grid).
public Color? Background { get; init; }
Property Value
Border
Gets the per-cell border style. Defaults to None. When set to anything other than None, a one-cell-thick box is drawn around the cell and the cell's content is inset by one cell on every side so it sits inside the border.
public BorderStyle Border { get; init; }
Property Value
Remarks
Backed by a nullable field so the unset default is None rather than the enum's zero value (DoubleLine); a default-constructed placement therefore has no border.
CellPadding
Gets the padding, in cells, that insets the cell's content from the cell edges (or from the inside of the border when Border is set). Defaults to None.
public Padding CellPadding { get; init; }
Property Value
Col
The zero-based column index of the cell's top-left corner.
public int Col { get; init; }
Property Value
ColSpan
The number of columns the cell occupies. Defaults to 1.
public int ColSpan { get; init; }
Property Value
Row
The zero-based row index of the cell's top-left corner.
public int Row { get; init; }
Property Value
RowSpan
The number of rows the cell occupies. Defaults to 1.
public int RowSpan { get; init; }