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, and dirty state.

public struct Cell : IEquatable<Cell>
Implements
Inherited Members

Constructors

Cell(char, Color, Color)

Creates a new cell with the specified values.

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

Parameters

character char
foreground Color
background Color

Fields

Background

The background color.

public Color Background

Field Value

Color

Character

The character to display.

public char Character

Field Value

char

Dirty

Whether this cell has been modified since the last render.

public bool Dirty

Field Value

bool

Foreground

The foreground color.

public Color Foreground

Field Value

Color

Properties

Blank

Gets a blank cell with default colors.

public static Cell Blank { get; }

Property Value

Cell

Methods

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

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