Skip to content

CellDecoratorHelpers Class

Helpers for CellDecorator and Decorators which manages null on the property.

C#
public static class CellDecoratorHelpers

Inheritance object

The list pool used for creating the decorator lists applied to cells.

C#
public static IListPool<CellDecorator> Pool { get; set; }

SetDecorators(IEnumerable<CellDecorator>?, ColoredGlyphBase)

Section titled “SetDecorators(IEnumerable<CellDecorator>?, ColoredGlyphBase)”

Replaces the decorators of a glyph.

C#
public static void SetDecorators(IEnumerable<CellDecorator>? decorators, ColoredGlyphBase glyph)

decorators IEnumerable<CellDecorator>
The decorators to set. null clears the decorators.

glyph ColoredGlyphBase
The glyph to alter.

SetDecorator(CellDecorator, ColoredGlyphBase)

Section titled “SetDecorator(CellDecorator, ColoredGlyphBase)”

Replaces the decorators of a glyph with a single decorator.

C#
public static void SetDecorator(CellDecorator decorator, ColoredGlyphBase glyph)

decorator CellDecorator
The decorator to set.

glyph ColoredGlyphBase
The glyph to alter.

AddDecorators(IEnumerable<CellDecorator>?, ColoredGlyphBase)

Section titled “AddDecorators(IEnumerable<CellDecorator>?, ColoredGlyphBase)”

Adds the decorators to a glyph.

C#
public static void AddDecorators(IEnumerable<CellDecorator>? decorators, ColoredGlyphBase glyph)

decorators IEnumerable<CellDecorator>
The decorators to add. Duplicates are skipped.

glyph ColoredGlyphBase
The glyph to alter.

AddDecorator(CellDecorator, ColoredGlyphBase)

Section titled “AddDecorator(CellDecorator, ColoredGlyphBase)”

Adds the specified decorator to a glyph.

C#
public static void AddDecorator(CellDecorator decorator, ColoredGlyphBase glyph)

decorator CellDecorator
The decorator to add.

glyph ColoredGlyphBase
The glyph to alter.

RemoveDecorators(IEnumerable<CellDecorator>, ColoredGlyphBase)

Section titled “RemoveDecorators(IEnumerable<CellDecorator>, ColoredGlyphBase)”

Removes the specified decorators from a glyph. If no decorators remain on the glyph, the Decorators collection is set to null.

C#
public static void RemoveDecorators(IEnumerable<CellDecorator> decorators, ColoredGlyphBase glyph)

decorators IEnumerable<CellDecorator>
The decorators to remove.

glyph ColoredGlyphBase
The glyph to alter.

Removes all decorators from a glyph, returns the list to the pool, and sets the Decorators collection to null.

C#
public static void RemoveAllDecorators(ColoredGlyphBase glyph)

glyph ColoredGlyphBase
The glyph to alter.

RemoveDecorator(CellDecorator, ColoredGlyphBase)

Section titled “RemoveDecorator(CellDecorator, ColoredGlyphBase)”

Removes the specified decorator from a glyph. If no decorators remain on the glyph, the Decorators collection is set to null.

C#
public static void RemoveDecorator(CellDecorator decorator, ColoredGlyphBase glyph)

decorator CellDecorator
The decorator to remove.

glyph ColoredGlyphBase
The glyph to alter.

Returns a new list of decorators from the Decorators property of glyph.

C#
public static List<CellDecorator>? CloneDecorators(ColoredGlyphBase glyph)

glyph ColoredGlyphBase
The glyph to copy the decorators from.

List<CellDecorator>
A list with all of the decorators from glyph. If the glyph’s decorators are null, null is returned.

ItemsMatch(List<CellDecorator>?, List<CellDecorator>?)

Section titled “ItemsMatch(List<CellDecorator>?, List<CellDecorator>?)”

Determines whether the contents of two CellDecorator arrays are equal.

C#
public static bool ItemsMatch(this List<CellDecorator>? self, List<CellDecorator>? other)

self List<CellDecorator>
The first object to compare.

other List<CellDecorator>
The second object to compare.

bool
A boolean value to indicate whether or not the two arrays are considered equal.