Show / Hide Table of Contents

Class ColoredGlyphBase

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

Inheritance
object
ColoredGlyphBase
ColoredGlyph
Implements
IMatchable<ColoredGlyphBase>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadConsole
Assembly: SadConsole.dll
Syntax
public abstract class ColoredGlyphBase : IMatchable<ColoredGlyphBase>

Constructors

ColoredGlyphBase()

Declaration
protected ColoredGlyphBase()

Properties

Background

The background color of this cell.

Declaration
public Color Background { get; set; }
Property Value
Type Description
Color

Decorators

Modifies the look of a cell with additional character.

Declaration
public List<CellDecorator>? Decorators { get; set; }
Property Value
Type Description
List<CellDecorator>

Foreground

The foreground color of this cell.

Declaration
public Color Foreground { get; set; }
Property Value
Type Description
Color

Glyph

The glyph index from a font for this cell.

Declaration
public int Glyph { get; set; }
Property Value
Type Description
int

GlyphCharacter

The glyph.

Declaration
[IgnoreDataMember]
public char GlyphCharacter { get; set; }
Property Value
Type Description
char

IsDirty

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

Declaration
public bool IsDirty { get; set; }
Property Value
Type Description
bool

IsVisible

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

Declaration
public bool IsVisible { get; set; }
Property Value
Type Description
bool

Mirror

The mirror effect for this cell.

Declaration
public Mirror Mirror { get; set; }
Property Value
Type Description
Mirror

Methods

Clear()

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

Declaration
public abstract void Clear()

Clone()

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

Declaration
public abstract ColoredGlyphBase Clone()
Returns
Type Description
ColoredGlyphBase

The new cell.

CopyAppearanceFrom(ColoredGlyphBase, bool)

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

Declaration
public virtual void CopyAppearanceFrom(ColoredGlyphBase cell, bool deepCopy = true)
Parameters
Type Name Description
ColoredGlyphBase cell

The target cell to copy from.

bool deepCopy

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.

CopyAppearanceTo(ColoredGlyphBase, bool)

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

Declaration
public virtual void CopyAppearanceTo(ColoredGlyphBase cell, bool deepCopy = true)
Parameters
Type Name Description
ColoredGlyphBase cell

The target cell to copy to.

bool deepCopy

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.

CreateArray(int)

Creates an array of colored glyphs.

Declaration
public static ColoredGlyphBase[] CreateArray(int size)
Parameters
Type Name Description
int size
Returns
Type Description
ColoredGlyphBase[]

Matches(ColoredGlyphBase?)

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

Declaration
public bool Matches(ColoredGlyphBase? other)
Parameters
Type Name Description
ColoredGlyphBase other

The other object to check.

Returns
Type Description
bool

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

Events

IsDirtySet

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

Declaration
public event EventHandler? IsDirtySet
Event Type
Type Description
EventHandler

Implements

IMatchable<T>

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX