Table of Contents

Struct Cell

Namespace
SharpConsoleUI.Layout
Assembly
SharpConsoleUI.dll

Represents a single character cell in the character buffer. Contains the character, foreground color, background color, decorations, and dirty state.

public struct Cell : IEquatable<Cell>
Implements
Inherited Members
Extension Methods

Constructors

Cell(char, Color, Color)

Creates a new cell with a char character.

public Cell(char character, Color foreground, Color background)

Parameters

character char
foreground Color
background Color

Cell(char, Color, Color, TextDecoration)

Creates a new cell with a char character and decorations.

public Cell(char character, Color foreground, Color background, TextDecoration decorations)

Parameters

character char
foreground Color
background Color
decorations TextDecoration

Cell(Rune, Color, Color)

Creates a new cell with a Rune character.

public Cell(Rune character, Color foreground, Color background)

Parameters

character Rune
foreground Color
background Color

Cell(Rune, Color, Color, TextDecoration)

Creates a new cell with a Rune character and decorations.

public Cell(Rune character, Color foreground, Color background, TextDecoration decorations)

Parameters

character Rune
foreground Color
background Color
decorations TextDecoration

Fields

Background

public Color Background

Field Value

Color

Character

public Rune Character

Field Value

Rune

Combiners

public string? Combiners

Field Value

string

Decorations

public TextDecoration Decorations

Field Value

TextDecoration

Dirty

public bool Dirty

Field Value

bool

Foreground

public Color Foreground

Field Value

Color

IsWideContinuation

public bool IsWideContinuation

Field Value

bool

Properties

Blank

Gets a blank cell with default colors.

public static Cell Blank { get; }

Property Value

Cell

Methods

AppendCombiner(Rune)

public void AppendCombiner(Rune r)

Parameters

r Rune

AsClean()

Returns a copy of this cell with the dirty flag cleared.

public Cell AsClean()

Returns

Cell

AsDirty()

Returns a copy of this cell with the dirty flag set.

public Cell AsDirty()

Returns

Cell

BlankWithBackground(Color)

Gets a blank cell with the specified background color.

public static Cell BlankWithBackground(Color background)

Parameters

background Color

Returns

Cell

Create(char, Color, Color)

Creates a cell with the specified character and colors.

public static Cell Create(char character, Color foreground, Color background)

Parameters

character char
foreground Color
background Color

Returns

Cell

Create(Rune, Color, Color)

Creates a cell with the specified Rune character and colors.

public static Cell Create(Rune character, Color foreground, Color background)

Parameters

character Rune
foreground Color
background Color

Returns

Cell

Equals(Cell)

Determines whether this cell equals another cell.

public bool Equals(Cell other)

Parameters

other Cell

Returns

bool

Equals(object?)

Determines whether this cell equals another object.

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Gets the hash code for this cell.

public override int GetHashCode()

Returns

int

ToString()

Returns a string representation of this cell.

public override string ToString()

Returns

string

VisuallyEquals(Cell)

Determines whether this cell has the same visual appearance as another. Does not compare dirty state.

public bool VisuallyEquals(Cell other)

Parameters

other Cell

Returns

bool

Operators

operator ==(Cell, Cell)

Equality operator.

public static bool operator ==(Cell left, Cell right)

Parameters

left Cell
right Cell

Returns

bool

operator !=(Cell, Cell)

Inequality operator.

public static bool operator !=(Cell left, Cell right)

Parameters

left Cell
right Cell

Returns

bool