Table of Contents

Class PromptBuilder

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Fluent builder for prompt controls

public sealed class PromptBuilder
Inheritance
PromptBuilder
Inherited Members

Methods

Build()

Builds the prompt control

public PromptControl Build()

Returns

PromptControl

OnEntered(WindowEventHandler<string>)

Sets the entered event handler with window access

public PromptBuilder OnEntered(WindowEventHandler<string> handler)

Parameters

handler WindowEventHandler<string>

Returns

PromptBuilder

OnEntered(EventHandler<string>)

Sets the entered event handler (fired when Enter is pressed)

public PromptBuilder OnEntered(EventHandler<string> handler)

Parameters

handler EventHandler<string>

Returns

PromptBuilder

OnGotFocus(WindowEventHandler<EventArgs>)

Sets the GotFocus event handler with window access

public PromptBuilder OnGotFocus(WindowEventHandler<EventArgs> handler)

Parameters

handler WindowEventHandler<EventArgs>

Handler that receives sender, event data, and window

Returns

PromptBuilder

The builder for chaining

OnGotFocus(EventHandler)

Sets the GotFocus event handler

public PromptBuilder OnGotFocus(EventHandler handler)

Parameters

handler EventHandler

The event handler to invoke when the prompt receives focus

Returns

PromptBuilder

The builder for chaining

OnInputChanged(WindowEventHandler<string>)

Sets the input changed event handler with window access

public PromptBuilder OnInputChanged(WindowEventHandler<string> handler)

Parameters

handler WindowEventHandler<string>

Returns

PromptBuilder

OnInputChanged(EventHandler<string>)

Sets the input changed event handler (fired when text changes)

public PromptBuilder OnInputChanged(EventHandler<string> handler)

Parameters

handler EventHandler<string>

Returns

PromptBuilder

OnLostFocus(WindowEventHandler<EventArgs>)

Sets the LostFocus event handler with window access

public PromptBuilder OnLostFocus(WindowEventHandler<EventArgs> handler)

Parameters

handler WindowEventHandler<EventArgs>

Handler that receives sender, event data, and window

Returns

PromptBuilder

The builder for chaining

OnLostFocus(EventHandler)

Sets the LostFocus event handler

public PromptBuilder OnLostFocus(EventHandler handler)

Parameters

handler EventHandler

The event handler to invoke when the prompt loses focus

Returns

PromptBuilder

The builder for chaining

StickyBottom()

Makes the control stick to the bottom of the window

public PromptBuilder StickyBottom()

Returns

PromptBuilder

StickyTop()

Makes the control stick to the top of the window

public PromptBuilder StickyTop()

Returns

PromptBuilder

UnfocusOnEnter(bool)

Sets whether the control loses focus when Enter is pressed

public PromptBuilder UnfocusOnEnter(bool unfocus = true)

Parameters

unfocus bool

Returns

PromptBuilder

Visible(bool)

Sets the visibility

public PromptBuilder Visible(bool visible = true)

Parameters

visible bool

Returns

PromptBuilder

WithAlignment(HorizontalAlignment)

Sets the horizontal alignment

public PromptBuilder WithAlignment(HorizontalAlignment alignment)

Parameters

alignment HorizontalAlignment

Returns

PromptBuilder

WithInput(string)

Sets the initial input value

public PromptBuilder WithInput(string input)

Parameters

input string

Returns

PromptBuilder

WithMargin(int)

Sets uniform margin

public PromptBuilder WithMargin(int margin)

Parameters

margin int

Returns

PromptBuilder

WithMargin(int, int, int, int)

Sets the margin

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

Parameters

left int
top int
right int
bottom int

Returns

PromptBuilder

WithName(string)

Sets the control name for lookup

public PromptBuilder WithName(string name)

Parameters

name string

Returns

PromptBuilder

WithPrompt(string)

Sets the prompt text (displayed before the input area)

public PromptBuilder WithPrompt(string prompt)

Parameters

prompt string

Returns

PromptBuilder

WithStickyPosition(StickyPosition)

Sets the sticky position

public PromptBuilder WithStickyPosition(StickyPosition position)

Parameters

position StickyPosition

Returns

PromptBuilder

WithTag(object)

Sets a tag object

public PromptBuilder WithTag(object tag)

Parameters

tag object

Returns

PromptBuilder

WithVerticalAlignment(VerticalAlignment)

Sets the vertical alignment

public PromptBuilder WithVerticalAlignment(VerticalAlignment alignment)

Parameters

alignment VerticalAlignment

Returns

PromptBuilder

WithWidth(int)

Sets the width

public PromptBuilder WithWidth(int width)

Parameters

width int

Returns

PromptBuilder

Operators

implicit operator PromptControl(PromptBuilder)

Implicit conversion to PromptControl

public static implicit operator PromptControl(PromptBuilder builder)

Parameters

builder PromptBuilder

Returns

PromptControl