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
TSelfThe 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
controlTThe control to configure.
Returns
- T
The configured control.
Type Parameters
TThe 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
visiblebool
Returns
- TSelf
WithHeight(int)
Sets an explicit height (rows); omit to fill the slot the parent allots.
public TSelf WithHeight(int height)
Parameters
heightint
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
alignmentHorizontalAlignment
Returns
- TSelf
WithMargin(Margin)
Sets the control margin.
public TSelf WithMargin(Margin margin)
Parameters
marginMargin
Returns
- TSelf
WithMargin(int)
Sets a uniform control margin.
public TSelf WithMargin(int margin)
Parameters
marginint
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
Returns
- TSelf
WithName(string)
Sets the control name (for lookup via FindControl).
public TSelf WithName(string name)
Parameters
namestring
Returns
- TSelf
WithPlaceholder(IWindowControl)
Sets the idle/done placeholder control shown when no flow is running.
public TSelf WithPlaceholder(IWindowControl placeholder)
Parameters
placeholderIWindowControl
Returns
- TSelf
WithStickyPosition(StickyPosition)
Sets the sticky position.
public TSelf WithStickyPosition(StickyPosition position)
Parameters
positionStickyPosition
Returns
- TSelf
WithTag(object)
Sets the control tag for custom data storage.
public TSelf WithTag(object tag)
Parameters
tagobject
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
alignmentVerticalAlignment
Returns
- TSelf
WithWidth(int)
Sets an explicit width (columns); omit to fill the parent's width.
public TSelf WithWidth(int width)
Parameters
widthint
Returns
- TSelf