Skip to content

ColoredGlyphBase Class

Represents an individual piece of a ICellSurface containing a glyph, foreground color, background color, and a mirror effect.

C#
public abstract class ColoredGlyphBase : IMatchable<ColoredGlyphBase>

Inheritance object

Implements IMatchable<ColoredGlyphBase>

C#
protected ColoredGlyphBase()

Modifies the look of a cell with additional character.

C#
public List<CellDecorator>? Decorators { get; set; }

The foreground color of this cell.

C#
public Color Foreground { get; set; }

The background color of this cell.

C#
public Color Background { get; set; }

The glyph index from a font for this cell.

C#
public int Glyph { get; set; }

The mirror effect for this cell.

C#
public Mirror Mirror { get; set; }

The glyph.

C#
[IgnoreDataMember]
public char GlyphCharacter { get; set; }

true when this cell should be drawn; otherwise, false.

C#
public bool IsVisible { get; set; }

true when this cell needs to be redrawn; otherwise, false.

C#
public bool IsDirty { get; set; }

Copies the visual appearance to the specified cell. This includes foreground, background, glyph, mirror effect and decorators.

C#
public virtual void CopyAppearanceTo(ColoredGlyphBase cell, bool deepCopy = true)

cell ColoredGlyphBase
The target cell to copy to.

deepCopy bool
Whether to perform a deep copy. Decorators are copied to a new array when true; when false, the old decorator array reference is moved directly.

CopyAppearanceFrom(ColoredGlyphBase, bool)

Section titled “CopyAppearanceFrom(ColoredGlyphBase, bool)”

Sets the foreground, background, glyph, mirror effect and decorators to the same as the specified cell.

C#
public virtual void CopyAppearanceFrom(ColoredGlyphBase cell, bool deepCopy = true)

cell ColoredGlyphBase
The target cell to copy from.

deepCopy bool
Whether to perform a deep copy. Decorators are copied to a new array when true; when false, the old decorator array reference is moved directly.

Resets the foreground, background, glyph, mirror effect and decorators.

C#
public abstract void Clear()

Returns a new cell with the same properties as this one.

C#
public abstract ColoredGlyphBase Clone()

ColoredGlyphBase
The new cell.

Checks if this ColoredGlyph object’s properties match another’s.

C#
public bool Matches(ColoredGlyphBase? other)

other ColoredGlyphBase
The other object to check.

bool
Returns true when the object’s properties match; otherwise false.

Creates an array of colored glyphs.

C#
public static ColoredGlyphBase[] CreateArray(int size)

size int

ColoredGlyphBase[]

An event that is raised when the IsDirty property is set to true.

C#
public event EventHandler? IsDirtySet

EventHandler