PromptPlus API:IControlSelect
IControlSelect<T>
Namespace: PPlus.Controls
Represents the interface with all Methods of the Select control
public interface IControlSelect<T> : IPromptControls<T>
Type Parameters
T
typeof return
Implements IPromptControls<T>
Methods
AddItem(T, Boolean)
Add item to list
IControlSelect<T> AddItem(T value, bool disable)
Parameters
value
T
Item to add
disable
Boolean
true item disabled, otherwise no
Returns
AddItemGrouped(String, T, Boolean)
Add Item in a group to list
AddItemGrouped cannot be used with OrderBy/OrderByDescending
IControlSelect<T> AddItemGrouped(string group, T value, bool disable)
Parameters
group
String
Group name
value
T
Item to add
disable
Boolean
true item disabled, otherwise no
Returns
AddItems(IEnumerable<T>, Boolean)
Add items colletion to list
IControlSelect<T> AddItems(IEnumerable<T> values, bool disable)
Parameters
values
IEnumerable<T>
items colletion to add
disable
Boolean
true item disabled, otherwise no
Returns
AddItemsGrouped(String, IEnumerable<T>, Boolean)
Add Items colletion in a group to List
AddItemsGrouped cannot be used with OrderBy/OrderByDescending
IControlSelect<T> AddItemsGrouped(string group, IEnumerable<T> value, bool disable)
Parameters
group
String
Group name
value
IEnumerable<T>
items colletion to add
disable
Boolean
true item disabled, otherwise no
Returns
AddItemsTo(AdderScope, params T[])
Add Items colletion to scope Disable/Remove AdderScope
At startup the list items will be compared and will be removed or disabled
Tip: Use for custom comparer
IControlSelect<T> AddItemsTo(AdderScope scope, params T[] values)
Parameters
scope
AdderScope
scope Disable/Remove
values
T[]
items colletion
Returns
AddItemsTo(AdderScope, IEnumerable<T>)
Add Items colletion to scope Disable/Remove AdderScope
At startup the list items will be compared and will be removed or disabled
Tip: Use for custom comparer
IControlSelect<T> AddItemsTo(AdderScope scope, IEnumerable<T> values)
Parameters
scope
AdderScope
scope Disable/Remove
values
IEnumerable<T>
items colletion
Returns
AutoSelect(Boolean)
Automatically select and finalize item when only one item is in the list . Default false.
IControlSelect<T> AutoSelect(bool value)
Parameters
value
Boolean
Automatically select
Returns
ChangeDescription(Func<T, String>)
Dynamically change the description using a user role
IControlSelect<T> ChangeDescription(Func<T, String> value)
Parameters
value
Func<T, String>
function to apply change
Returns
Config(Action<IPromptConfig>)
Custom config the control.
IControlSelect<T> Config(Action<IPromptConfig> context)
Parameters
context
Action<IPromptConfig>
action to apply changes. IPromptConfig
Returns
Default(T)
Default value selected.
IControlSelect<T> Default(T value)
Parameters
value
T
Value default
Returns
EqualItems(Func<T, T, Boolean>)
Custom item comparator
IControlSelect<T> EqualItems(Func<T, T, Boolean> comparer)
Parameters
comparer
Func<T, T, Boolean>
function comparator
Returns
FilterType(FilterMode)
Filter strategy for filter items in colletion
Default value is FilterMode.Contains
IControlSelect<T> FilterType(FilterMode value)
Parameters
value
FilterMode
Filter Mode
Returns
Interaction<T1>(IEnumerable<T1>, Action<IControlSelect<T>, T1>)
Execute a action foreach item of colletion passed as a parameter
IControlSelect<T> Interaction<T1>(IEnumerable<T1> values, Action<IControlSelect<T>, T1> action)
Type Parameters
T1
Type external colletion
Parameters
values
IEnumerable<T1>
Colletion for interaction
action
Action<IControlSelect<T>, T1>
Action to execute
Returns
OrderBy(Expression<Func<T, Object>>)
Sort list by expression
OrderBy cannot be used Separator or Grouped item
IControlSelect<T> OrderBy(Expression<Func<T, Object>> value)
Parameters
value
Expression<Func<T, Object>>
expresion to sort the colletion
Returns
OrderByDescending(Expression<Func<T, Object>>)
Sort Descending list by expression
OrderByDescending cannot be used Separator or Grouped item
IControlSelect<T> OrderByDescending(Expression<Func<T, Object>> value)
Parameters
value
Expression<Func<T, Object>>
expresion to sort the colletion
Returns
OverwriteDefaultFrom(String, Nullable<TimeSpan>)
Overwrite defaults start selected value with last result saved on history.
IControlSelect<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
PageSize(Int32)
Set max.item view per page.
Default value : 10.The value must be greater than or equal to 1
IControlSelect<T> PageSize(int value)
Parameters
value
Int32
Number of Max.items
Returns
Separator(SeparatorLine, Nullable<Char>)
Add Separation line
Separatorcannot be used with OrderBy/OrderByDescending
IControlSelect<T> Separator(SeparatorLine separatorLine, Nullable<Char> value)
Parameters
separatorLine
SeparatorLine
Type Separation line.Default value is SeparatorLine.SingleLine SeparatorLine
value
Nullable<Char>
Char Separation line. Valid only SeparatorLine is SeparatorLine.Char
Returns
ShowTipGroup(Boolean)
Show tip with text of group. Default false
IControlSelect<T> ShowTipGroup(bool value)
Parameters
value
Boolean
If True, it shows the tip with the group text, otherwise nothing.
Returns
Styles(SelectStyles, Style)
Overwrite Styles
IControlSelect<T> Styles(SelectStyles styletype, Style value)
Parameters
styletype
SelectStyles
SelectStyles of content
Returns
TextSelector(Func<T, String>)
Function to show text Item in list.Default value is Item.ToString()
IControlSelect<T> TextSelector(Func<T, String> value)
Parameters
value
Func<T, String>
Function to show text Item in list