Table of Contents

Class SeparatorControl

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

A simple vertical separator control for visually dividing UI elements. Unlike SplitterControl, this is non-interactive and non-focusable. Uses a single vertical line character for a subtle appearance.

public class SeparatorControl : IWindowControl, IDisposable, IDOMPaintable
Inheritance
SeparatorControl
Implements
Inherited Members
Extension Methods

Constructors

SeparatorControl()

Initializes a new instance of the SeparatorControl class.

public SeparatorControl()

Properties

ActualWidth

Gets the actual rendered width of the control, or null if not yet rendered.

public int? ActualWidth { get; }

Property Value

int?

BackgroundColor

Gets or sets the background color of the separator. When null, inherits from the container.

public Color? BackgroundColor { get; set; }

Property Value

Color?

Character

Gets or sets the character used to draw the separator. Defaults to '│' (single vertical line).

public char Character { get; set; }

Property Value

char

Container

Gets or sets the parent container that hosts this control.

public IContainer? Container { get; set; }

Property Value

IContainer

ForegroundColor

Gets or sets the foreground color of the separator. When null, uses theme's SeparatorForegroundColor, then falls back to container color.

public Color? ForegroundColor { get; set; }

Property Value

Color?

HorizontalAlignment

Gets or sets the horizontal alignment of the control within its container.

public HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

HorizontalAlignment

Margin

Gets or sets the margin (spacing) around the control.

public Margin Margin { get; set; }

Property Value

Margin

Name

Gets or sets the unique name identifier for this control, used for lookup.

public string? Name { get; set; }

Property Value

string

StickyPosition

Gets or sets whether this control should stick to the top or bottom during scrolling.

public StickyPosition StickyPosition { get; set; }

Property Value

StickyPosition

Tag

Gets or sets an arbitrary object value that can be used to store custom data.

public object? Tag { get; set; }

Property Value

object

VerticalAlignment

Gets or sets the vertical alignment of the control within its container.

public VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment

Visible

Gets or sets whether this control is visible.

public bool Visible { get; set; }

Property Value

bool

Width

Gets or sets the explicit width of the control, or null for automatic sizing.

public int? Width { get; set; }

Property Value

int?

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetLogicalContentSize()

Gets the logical size of the control's content without rendering.

public Size GetLogicalContentSize()

Returns

Size

The size representing the content's natural dimensions.

Invalidate()

Marks this control as needing to be re-rendered.

public void Invalidate()

MeasureDOM(LayoutConstraints)

Measures the control's desired size given the available constraints.

public LayoutSize MeasureDOM(LayoutConstraints constraints)

Parameters

constraints LayoutConstraints

The layout constraints (min/max width/height).

Returns

LayoutSize

The desired size of the control.

PaintDOM(CharacterBuffer, LayoutRect, LayoutRect, Color, Color)

Paints the control's content directly to a CharacterBuffer.

public void PaintDOM(CharacterBuffer buffer, LayoutRect bounds, LayoutRect clipRect, Color defaultFg, Color defaultBg)

Parameters

buffer CharacterBuffer

The buffer to paint to.

bounds LayoutRect

The absolute bounds where the control should paint.

clipRect LayoutRect

The clipping rectangle (visible area).

defaultFg Color
defaultBg Color