Table of Contents

Class DatePickerBuilder

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Fluent builder for creating and configuring DatePicker controls.

public sealed class DatePickerBuilder : IControlBuilder<DatePickerControl>
Inheritance
DatePickerBuilder
Implements
Inherited Members
Extension Methods

Methods

Build()

Builds the date picker control.

public DatePickerControl Build()

Returns

DatePickerControl

The configured DatePickerControl.

OnGotFocus(WindowEventHandler<EventArgs>)

Sets the GotFocus event handler with window access.

public DatePickerBuilder OnGotFocus(WindowEventHandler<EventArgs> handler)

Parameters

handler WindowEventHandler<EventArgs>

The event handler with window access.

Returns

DatePickerBuilder

The builder for chaining.

OnGotFocus(EventHandler)

Sets the GotFocus event handler.

public DatePickerBuilder OnGotFocus(EventHandler handler)

Parameters

handler EventHandler

The event handler.

Returns

DatePickerBuilder

The builder for chaining.

OnLostFocus(WindowEventHandler<EventArgs>)

Sets the LostFocus event handler with window access.

public DatePickerBuilder OnLostFocus(WindowEventHandler<EventArgs> handler)

Parameters

handler WindowEventHandler<EventArgs>

The event handler with window access.

Returns

DatePickerBuilder

The builder for chaining.

OnLostFocus(EventHandler)

Sets the LostFocus event handler.

public DatePickerBuilder OnLostFocus(EventHandler handler)

Parameters

handler EventHandler

The event handler.

Returns

DatePickerBuilder

The builder for chaining.

OnSelectedDateChanged(WindowEventHandler<DateTime?>)

Sets the selected date changed event handler with window access.

public DatePickerBuilder OnSelectedDateChanged(WindowEventHandler<DateTime?> handler)

Parameters

handler WindowEventHandler<DateTime?>

The event handler with window access.

Returns

DatePickerBuilder

The builder for chaining.

OnSelectedDateChanged(EventHandler<DateTime?>)

Sets the selected date changed event handler.

public DatePickerBuilder OnSelectedDateChanged(EventHandler<DateTime?> handler)

Parameters

handler EventHandler<DateTime?>

The event handler.

Returns

DatePickerBuilder

The builder for chaining.

StickyBottom()

Makes the control stick to the bottom of the window.

public DatePickerBuilder StickyBottom()

Returns

DatePickerBuilder

The builder for chaining.

StickyTop()

Makes the control stick to the top of the window.

public DatePickerBuilder StickyTop()

Returns

DatePickerBuilder

The builder for chaining.

Visible(bool)

Sets the visibility.

public DatePickerBuilder Visible(bool visible = true)

Parameters

visible bool

Whether the control is visible.

Returns

DatePickerBuilder

The builder for chaining.

WithAlignment(HorizontalAlignment)

Sets the horizontal alignment.

public DatePickerBuilder WithAlignment(HorizontalAlignment alignment)

Parameters

alignment HorizontalAlignment

The horizontal alignment.

Returns

DatePickerBuilder

The builder for chaining.

WithCulture(CultureInfo)

Sets the culture for date formatting and calendar layout.

public DatePickerBuilder WithCulture(CultureInfo culture)

Parameters

culture CultureInfo

The culture to use.

Returns

DatePickerBuilder

The builder for chaining.

WithFirstDayOfWeek(DayOfWeek)

Sets the first day of the week for the calendar.

public DatePickerBuilder WithFirstDayOfWeek(DayOfWeek dayOfWeek)

Parameters

dayOfWeek DayOfWeek

The first day of the week.

Returns

DatePickerBuilder

The builder for chaining.

WithFormat(string)

Sets a custom date format string.

public DatePickerBuilder WithFormat(string format)

Parameters

format string

The date format string.

Returns

DatePickerBuilder

The builder for chaining.

WithMargin(int)

Sets uniform margin on all sides.

public DatePickerBuilder WithMargin(int margin)

Parameters

margin int

The margin value for all sides.

Returns

DatePickerBuilder

The builder for chaining.

WithMargin(int, int, int, int)

Sets the margin.

public DatePickerBuilder 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

DatePickerBuilder

The builder for chaining.

WithMaxDate(DateTime?)

Sets the maximum selectable date.

public DatePickerBuilder WithMaxDate(DateTime? date)

Parameters

date DateTime?

The maximum date.

Returns

DatePickerBuilder

The builder for chaining.

WithMinDate(DateTime?)

Sets the minimum selectable date.

public DatePickerBuilder WithMinDate(DateTime? date)

Parameters

date DateTime?

The minimum date.

Returns

DatePickerBuilder

The builder for chaining.

WithName(string)

Sets the control name for lookup.

public DatePickerBuilder WithName(string name)

Parameters

name string

The control name.

Returns

DatePickerBuilder

The builder for chaining.

WithPrompt(string)

Sets the prompt text displayed in the date picker header.

public DatePickerBuilder WithPrompt(string prompt)

Parameters

prompt string

The prompt text.

Returns

DatePickerBuilder

The builder for chaining.

WithSelectedDate(DateTime?)

Sets the initially selected date.

public DatePickerBuilder WithSelectedDate(DateTime? date)

Parameters

date DateTime?

The date to select.

Returns

DatePickerBuilder

The builder for chaining.

WithStickyPosition(StickyPosition)

Sets the sticky position.

public DatePickerBuilder WithStickyPosition(StickyPosition position)

Parameters

position StickyPosition

The sticky position.

Returns

DatePickerBuilder

The builder for chaining.

WithTag(object)

Sets a tag object.

public DatePickerBuilder WithTag(object tag)

Parameters

tag object

The tag object.

Returns

DatePickerBuilder

The builder for chaining.

WithVerticalAlignment(VerticalAlignment)

Sets the vertical alignment.

public DatePickerBuilder WithVerticalAlignment(VerticalAlignment alignment)

Parameters

alignment VerticalAlignment

The vertical alignment.

Returns

DatePickerBuilder

The builder for chaining.

WithWidth(int)

Sets the width.

public DatePickerBuilder WithWidth(int width)

Parameters

width int

The width in columns.

Returns

DatePickerBuilder

The builder for chaining.

Operators

implicit operator DatePickerControl(DatePickerBuilder)

Implicit conversion to DatePickerControl.

public static implicit operator DatePickerControl(DatePickerBuilder builder)

Parameters

builder DatePickerBuilder

The builder to convert.

Returns

DatePickerControl