Skip to the content.

PromptPlus API:IControlTableSelect

Build Publish License NuGet Downloads

Back to List Api

IControlTableSelect<T>

Namespace: PPlus.Controls

Represents the interface with all Methods of the Table Select control

public interface IControlTableSelect<T> : IPromptControls<ResultTableSelect<T>>

Type Parameters

T

Implements IPromptControls<ResultTableSelect<T>>

Methods

AddColumn(Expression<Func<T, Object>>, UInt16, Func<Object, String>, Alignment, String, Alignment, Boolean, Boolean, Nullable<UInt16>)

Add Column
AddColumn cannot be used with AutoFill

IControlTableSelect<T> AddColumn(Expression<Func<T, Object>> field, ushort width, Func<Object, String> format, Alignment alignment, string title, Alignment titlealignment, bool titlereplaceswidth, bool textcrop, Nullable<UInt16> maxslidinglines)

Parameters

field Expression<Func<T, Object>>
Expression that defines the field associated with the column

width UInt16
column size

format Func<Object, String>
Function to format the field.If not informed, it will be ToString()

alignment Alignment
alignment content

title String
The Column title

titlealignment Alignment
alignment title

titlereplaceswidth Boolean
title width overrides column width when greater

textcrop Boolean
If true the value will be truncated by the column size, otherwise, the content will be written in several lines

maxslidinglines Nullable<UInt16>
Maximum Sliding Lines when the content length is greater than the column size and textcrop = false.

Returns

IControlTableSelect<T>

AddFormatType<T1>(Func<Object, String>)

Function to format columns by field type when not specified by ‘AddColumn’.

IControlTableSelect<T> AddFormatType<T1>(Func<Object, String> funcfomatType)

Type Parameters

T1
Type to convert

Parameters

funcfomatType Func<Object, String>
The function

Returns

IControlTableSelect<T>

AddItem(T, Boolean)

Add item to list

IControlTableSelect<T> AddItem(T value, bool disable)

Parameters

value T
Item to add

disable Boolean
true item disabled, otherwise no

Returns

IControlTableSelect<T>

AddItems(IEnumerable<T>, Boolean)

Add items to list

IControlTableSelect<T> AddItems(IEnumerable<T> values, bool disable)

Parameters

values IEnumerable<T>
items colletion to add

disable Boolean
true item disabled, otherwise no

Returns

IControlTableSelect<T>

AddItemsTo(AdderScope, params T[])

Add Items to list with scope Disable/Remove AdderScope
At startup the list items will be compared and will be removed or disabled
Tip: Use for custom comparer

IControlTableSelect<T> AddItemsTo(AdderScope scope, params T[] values)

Parameters

scope AdderScope
scope Disable/Remove

values T[]
items colletion

Returns

IControlTableSelect<T>

AutoFill(params Nullable<UInt16>[])

Auto generate Columns
AutoFill cannot be used with AddColumn and/or AutoFit
Header alignment will always be ‘Center’
The content alignment will always be ‘Left’ and will always be with sliding lines
Columns are generated by the public properties of the data class recognized by .
TypeCode.DBNull and TypeCode.Object will be ignored.
The column size will be automatically adjusted by the title size (Name property) and the minmaxwidth parameter or content width when min/max width is null

IControlTableSelect<T> AutoFill(params Nullable<UInt16>[] minmaxwidth)

Parameters

minmaxwidth Nullable<UInt16>[]
minimum and maximum width

Returns

IControlTableSelect<T>

AutoFit(params UInt16[])

Set the grid to auto-resize to current console width
AutoFit cannot be used with AutoFill

IControlTableSelect<T> AutoFit(params UInt16[] indexColumn)

Parameters

indexColumn UInt16[]
List (cardinality) of columns that will be affected.
If none all columns that will be affected

Returns

IControlTableSelect<T>

AutoSelect(Boolean)

Automatically select and finalize item when only one item is in the list . Default false.

IControlTableSelect<T> AutoSelect(bool value)

Parameters

value Boolean
Automatically select

Returns

IControlTableSelect<T>

ChangeDescription(Func<T, Int32, Int32, String>)

Dynamically change the description using a user role

IControlTableSelect<T> ChangeDescription(Func<T, Int32, Int32, String> value)

Parameters

value Func<T, Int32, Int32, String>
function to apply change
Func(T, int, int, string) = T = item, int = current row (base0) , int = current col (base0)

Returns

IControlTableSelect<T>

ColumnsNavigation(Boolean)

Enable Columns Navigation when Templates is active. Default false.
When the column size is greater than the screen size, the content will be truncated

IControlTableSelect<T> ColumnsNavigation(bool value)

Parameters

value Boolean
Enable Columns Navigation

Returns

IControlTableSelect<T>

Config(Action<IPromptConfig>)

Custom config the control.

IControlTableSelect<T> Config(Action<IPromptConfig> context)

Parameters

context Action<IPromptConfig>
action to apply changes. IPromptConfig

Returns

IControlTableSelect<T>

Default(T)

Default value selected.

IControlTableSelect<T> Default(T value)

Parameters

value T
Value default

Returns

IControlTableSelect<T>

EqualItems(Func<T, T, Boolean>)

Custom item comparator

IControlTableSelect<T> EqualItems(Func<T, T, Boolean> comparer)

Parameters

comparer Func<T, T, Boolean>
function comparator

Returns

IControlTableSelect<T>

FilterByColumns(FilterMode, params UInt16[])

Set Columns used by Filter strategy.

IControlTableSelect<T> FilterByColumns(FilterMode filter, params UInt16[] indexColumn)

Parameters

filter FilterMode
Filter strategy for filter rows.Default value is FilterMode.Disabled

indexColumn UInt16[]
list (cardinality) of columns

Returns

IControlTableSelect<T>

HideHeaders(Boolean)

Hide columns headers. Default false.

IControlTableSelect<T> HideHeaders(bool value)

Parameters

value Boolean
Hide headers

Returns

IControlTableSelect<T>

HideSelectorRow(Boolean)

Hide selector row. Default false.

IControlTableSelect<T> HideSelectorRow(bool value)

Parameters

value Boolean
Hide selector row

Returns

IControlTableSelect<T>

Interaction<T1>(IEnumerable<T1>, Action<IControlTableSelect<T>, T1>)

Execute a action foreach item of colletion passed as a parameter

IControlTableSelect<T> Interaction<T1>(IEnumerable<T1> values, Action<IControlTableSelect<T>, T1> action)

Type Parameters

T1
Layout external colletion

Parameters

values IEnumerable<T1>
Colletion for interaction

action Action<IControlTableSelect<T>, T1>
Action to execute

Returns

IControlTableSelect<T>

Layout(TableLayout)

The Table layout. Default value is ‘TableLayout.SingleGridFull’

IControlTableSelect<T> Layout(TableLayout value)

Parameters

value TableLayout
The TableLayout

Returns

IControlTableSelect<T>

OrderBy(Expression<Func<T, Object>>)

Sort items by expression

IControlTableSelect<T> OrderBy(Expression<Func<T, Object>> value)

Parameters

value Expression<Func<T, Object>>
expresion to sort the rows

Returns

IControlTableSelect<T>

OrderByDescending(Expression<Func<T, Object>>)

Sort Descending items by expression

IControlTableSelect<T> OrderByDescending(Expression<Func<T, Object>> value)

Parameters

value Expression<Func<T, Object>>
expresion to sort the rows

Returns

IControlTableSelect<T>

OverwriteDefaultFrom(String, Nullable<TimeSpan>)

Overwrite defaults start selected value with last result saved on history.

IControlTableSelect<T> OverwriteDefaultFrom(string value, Nullable<TimeSpan> timeout)

Parameters

value String
name of file to save history

timeout Nullable<TimeSpan>
The timeout for valid items saved. Default value is 365 days

Returns

IControlTableSelect<T>

PageSize(Int32)

Set max.item view per page.
Default value : 10.The value must be greater than or equal to 1

IControlTableSelect<T> PageSize(int value)

Parameters

value Int32
Number of Max.rows

Returns

IControlTableSelect<T>

SeparatorRows(Boolean)

Set separator between rows. Default false.

IControlTableSelect<T> SeparatorRows(bool value)

Parameters

value Boolean
separator between rows

Returns

IControlTableSelect<T>

Styles(TableSelectStyle, Style)

Overwrite Styles

IControlTableSelect<T> Styles(TableSelectStyle content, Style value)

Parameters

content TableSelectStyle
TableSelectStyle of content

value Style
The Style

Returns

IControlTableSelect<T>

Templates(Func<T, Int32, Int32, String>, Func<T, Int32, Int32, String>)

Template for selected item and finished select

IControlTableSelect<T> Templates(Func<T, Int32, Int32, String> selectedTemplate, Func<T, Int32, Int32, String> finishTemplate)

Parameters

selectedTemplate Func<T, Int32, Int32, String>
message template function when selected item.
Func(T, int, int, string) = T = item, int = current row (base0) , int = current col (base0)

finishTemplate Func<T, Int32, Int32, String>
message template function when finish control with seleted item
Func(T, int, int, string) = T = item, int = current row (base0) , int = current col (base0)

Returns

IControlTableSelect<T>

Title(String, Alignment, TableTitleMode)

Set Title Table

IControlTableSelect<T> Title(string value, Alignment alignment, TableTitleMode titleMode)

Parameters

value String
Title

alignment Alignment
alignment title. Default value is Alignment.Center

titleMode TableTitleMode
InLine(Default): Write the title above the grid. InRow : Write the title inside the grid as a row

Returns

IControlTableSelect<T>


Back to List Api