Table of Contents

Class MarkupBuilder

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Fluent builder for markup controls

public sealed class MarkupBuilder
Inheritance
MarkupBuilder
Inherited Members

Methods

AddEmptyLine()

Adds an empty line

public MarkupBuilder AddEmptyLine()

Returns

MarkupBuilder

The builder for chaining

AddLine(string)

Adds a line of markup text

public MarkupBuilder AddLine(string markup)

Parameters

markup string

The markup text

Returns

MarkupBuilder

The builder for chaining

AddLines(params string[])

Adds multiple lines of markup text

public MarkupBuilder AddLines(params string[] markupLines)

Parameters

markupLines string[]

The markup lines

Returns

MarkupBuilder

The builder for chaining

AlignBottom()

Aligns content to the bottom

public MarkupBuilder AlignBottom()

Returns

MarkupBuilder

The builder for chaining

AlignTop()

Aligns content to the top

public MarkupBuilder AlignTop()

Returns

MarkupBuilder

The builder for chaining

Build()

Builds the markup control

public MarkupControl Build()

Returns

MarkupControl

The configured markup control

Centered()

Centers the content horizontally

public MarkupBuilder Centered()

Returns

MarkupBuilder

The builder for chaining

Clear()

Clears all lines

public MarkupBuilder Clear()

Returns

MarkupBuilder

The builder for chaining

FillVertical()

Makes the content fill vertically

public MarkupBuilder FillVertical()

Returns

MarkupBuilder

The builder for chaining

StickyBottom()

Makes the control stick to the bottom of the window

public MarkupBuilder StickyBottom()

Returns

MarkupBuilder

The builder for chaining

StickyTop()

Makes the control stick to the top of the window

public MarkupBuilder StickyTop()

Returns

MarkupBuilder

The builder for chaining

VerticallyCentered()

Centers the content vertically

public MarkupBuilder VerticallyCentered()

Returns

MarkupBuilder

The builder for chaining

Visible(bool)

Sets the visibility

public MarkupBuilder Visible(bool visible = true)

Parameters

visible bool

Whether the control is visible

Returns

MarkupBuilder

The builder for chaining

WithAlignment(HorizontalAlignment)

Sets the alignment

public MarkupBuilder WithAlignment(HorizontalAlignment alignment)

Parameters

alignment HorizontalAlignment

The alignment

Returns

MarkupBuilder

The builder for chaining

WithBackgroundColor(Color)

Sets the background color for the control

public MarkupBuilder WithBackgroundColor(Color color)

Parameters

color Color

The background color

Returns

MarkupBuilder

The builder for chaining

WithColors(Color, Color)

Sets both foreground and background colors for the control

public MarkupBuilder WithColors(Color foreground, Color background)

Parameters

foreground Color

The foreground (text) color

background Color

The background color

Returns

MarkupBuilder

The builder for chaining

WithForegroundColor(Color)

Sets the foreground (text) color for the control

public MarkupBuilder WithForegroundColor(Color color)

Parameters

color Color

The foreground color

Returns

MarkupBuilder

The builder for chaining

WithMargin(int)

Sets uniform margin

public MarkupBuilder WithMargin(int margin)

Parameters

margin int

The margin value for all sides

Returns

MarkupBuilder

The builder for chaining

WithMargin(int, int, int, int)

Sets the margin

public MarkupBuilder WithMargin(int left, int top, int right, int bottom)

Parameters

left int

Left margin

top int

Top margin

right int

Right margin

bottom int

Bottom margin

Returns

MarkupBuilder

The builder for chaining

WithName(string)

Sets the control name for lookup

public MarkupBuilder WithName(string name)

Parameters

name string

The control name

Returns

MarkupBuilder

The builder for chaining

WithStickyPosition(StickyPosition)

Sets the sticky position

public MarkupBuilder WithStickyPosition(StickyPosition position)

Parameters

position StickyPosition

The sticky position

Returns

MarkupBuilder

The builder for chaining

WithTag(object)

Sets a tag object

public MarkupBuilder WithTag(object tag)

Parameters

tag object

The tag object

Returns

MarkupBuilder

The builder for chaining

WithVerticalAlignment(VerticalAlignment)

Sets the vertical alignment

public MarkupBuilder WithVerticalAlignment(VerticalAlignment alignment)

Parameters

alignment VerticalAlignment

The vertical alignment

Returns

MarkupBuilder

The builder for chaining

WithWidth(int)

Sets the width

public MarkupBuilder WithWidth(int width)

Parameters

width int

The control width

Returns

MarkupBuilder

The builder for chaining

Operators

implicit operator MarkupControl(MarkupBuilder)

Implicit conversion to MarkupControl

public static implicit operator MarkupControl(MarkupBuilder builder)

Parameters

builder MarkupBuilder

The builder

Returns

MarkupControl

The built markup control