Table of Contents

Class FlowControlBuilderBase<TSelf>

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Shared fluent builder base for FlowControl and its subclasses (e.g. WizardControl). It is self-typed (TSelf) so every fluent method returns the concrete builder type, keeping the chain intact through inheritance; subclasses only choose which control Apply<T>(T) is given. The control's own layout defaults (Fill / Stretch) are preserved unless explicitly overridden, since a FlowControl must fill the slot it is placed in (overriding them with the usual Top/Left would collapse the inline region to a single row).

public abstract class FlowControlBuilderBase<TSelf> where TSelf : FlowControlBuilderBase<TSelf>

Type Parameters

TSelf

The concrete builder type (returned from every fluent method).

Inheritance
FlowControlBuilderBase<TSelf>
Derived
Inherited Members
Extension Methods

Methods

Apply<T>(T)

Applies the builder's configuration to control and returns it. Subclasses call this from their Build() with the concrete FlowControl they construct.

protected T Apply<T>(T control) where T : FlowControl

Parameters

control T

The control to configure.

Returns

T

The configured control.

Type Parameters

T

The concrete FlowControl type to configure.

StickyBottom()

Makes the control stick to the bottom of the window.

public TSelf StickyBottom()

Returns

TSelf

StickyTop()

Makes the control stick to the top of the window.

public TSelf StickyTop()

Returns

TSelf

Visible(bool)

Sets whether the control is visible.

public TSelf Visible(bool visible = true)

Parameters

visible bool

Returns

TSelf

WithHeight(int)

Sets an explicit height (rows); omit to fill the slot the parent allots.

public TSelf WithHeight(int height)

Parameters

height int

Returns

TSelf

WithHorizontalAlignment(HorizontalAlignment)

Overrides the horizontal alignment (default Stretch). Changing this away from Stretch may collapse the inline region — prefer leaving the default.

public TSelf WithHorizontalAlignment(HorizontalAlignment alignment)

Parameters

alignment HorizontalAlignment

Returns

TSelf

WithMargin(Margin)

Sets the control margin.

public TSelf WithMargin(Margin margin)

Parameters

margin Margin

Returns

TSelf

WithMargin(int)

Sets a uniform control margin.

public TSelf WithMargin(int margin)

Parameters

margin int

Returns

TSelf

WithMargin(int, int, int, int)

Sets the control margin (left, top, right, bottom).

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

Parameters

left int
top int
right int
bottom int

Returns

TSelf

WithName(string)

Sets the control name (for lookup via FindControl).

public TSelf WithName(string name)

Parameters

name string

Returns

TSelf

WithPlaceholder(IWindowControl)

Sets the idle/done placeholder control shown when no flow is running.

public TSelf WithPlaceholder(IWindowControl placeholder)

Parameters

placeholder IWindowControl

Returns

TSelf

WithStickyPosition(StickyPosition)

Sets the sticky position.

public TSelf WithStickyPosition(StickyPosition position)

Parameters

position StickyPosition

Returns

TSelf

WithTag(object)

Sets the control tag for custom data storage.

public TSelf WithTag(object tag)

Parameters

tag object

Returns

TSelf

WithVerticalAlignment(VerticalAlignment)

Overrides the vertical alignment (default Fill). Changing this away from Fill may collapse the inline region — prefer leaving the default.

public TSelf WithVerticalAlignment(VerticalAlignment alignment)

Parameters

alignment VerticalAlignment

Returns

TSelf

WithWidth(int)

Sets an explicit width (columns); omit to fill the parent's width.

public TSelf WithWidth(int width)

Parameters

width int

Returns

TSelf