PromptPlus API:IControlInput
IControlInput
Namespace: PPlus.Controls
Represents the interface with all Methods of the Input control
public interface IControlInput : IPromptControls<String>
Implements IPromptControls<String>
Methods
AcceptInput(Func<Char, Boolean>)
Execute a function to accept char input.
If result true accept char input; otherwise, ignore char input.
IControlInput AcceptInput(Func<Char, Boolean> value)
Parameters
value
Func<Char, Boolean>
function to accept
Returns
AddValidators(params Func<Object, ValidationResult>[])
Add a validator to accept sucessfull finish of control.
Tip: see to validators embedding
IControlInput AddValidators(params Func<Object, ValidationResult>[] validators)
Parameters
validators
Func<Object, ValidationResult>[]
the function validator.
Returns
ChangeDescription(Func<String, String>)
Dynamically change the description using a user role
IControlInput ChangeDescription(Func<String, String> value)
Parameters
value
Func<String, String>
function to apply change
Returns
Config(Action<IPromptConfig>)
Custom config the control.
IControlInput Config(Action<IPromptConfig> context)
Parameters
context
Action<IPromptConfig>
action to apply changes. IPromptConfig
Returns
Default(String)
Default value when stated.
Default cannot be used with IsSecret
IControlInput Default(string value)
Parameters
value
String
Value default
Returns
DefaultIfEmpty(String)
Default value when finished value is empty.
IControlInput DefaultIfEmpty(string value)
Parameters
value
String
Finished value default
Returns
EnabledViewSecret(Nullable<HotKey>)
Enable user to view the input without mask.
IControlInput EnabledViewSecret(Nullable<HotKey> hotkeypress)
Parameters
hotkeypress
Nullable<HotKey>
Overwrite a HotKey to toggle view. Default value is ‘F2’
Returns
HistoryEnabled(String)
Enabled saved history inputs.
HistoryEnabled cannot be used with IsSecret
The history file is saved in in the ‘PromptPlus.History’ folder.
IControlInput HistoryEnabled(string value)
Parameters
value
String
name of file to saved history
Returns
HistoryMaxItems(Byte)
Set maximum items saved on history.After maximum the items are rotates.
IControlInput HistoryMaxItems(byte value)
Parameters
value
Byte
maximum items saved
Returns
HistoryMinimumPrefixLength(Int32)
Minimum chars to enabled history feature. Default value is 0.
History items are filtered by the starts with entry.
When command FilterType set to Disabled History items the value must be zero
IControlInput HistoryMinimumPrefixLength(int value)
Parameters
value
Int32
Minimum chars number
Returns
HistoryPageSize(Int32)
Set max.item view per page on history.Default value for this control is 10.
IControlInput HistoryPageSize(int value)
Parameters
value
Int32
Number of Max.items
Returns
HistoryTimeout(TimeSpan)
Set timeout to valid items saved on history. Default value is 365 days.
IControlInput HistoryTimeout(TimeSpan value)
Parameters
value
TimeSpan
timeout value
Returns
InputToCase(CaseOptions)
Transform char input using CaseOptions.
IControlInput InputToCase(CaseOptions value)
Parameters
value
CaseOptions
Transform option
Returns
IsSecret(Nullable<Char>)
The input is a secret. the input text is masked to ‘#’ (default value)
Input secret cannot be used with suggestionhandler
Input secret cannot be used with DefaultEmptyValue
Input secret cannot be used with DefaultValue
Input secret cannot be used with OverwriteDefaultFrom
Input secret cannot be used with HistoryEnabled
IControlInput IsSecret(Nullable<Char> value)
Parameters
value
Nullable<Char>
char secret
Returns
MaxLength(UInt16)
MaxLength of input text.The value must be greater than or equal to 1
Default value is 0 (no limit)
IControlInput MaxLength(ushort value)
Parameters
value
UInt16
Length
Returns
OverwriteDefaultFrom(String, Nullable<TimeSpan>)
Overwrite default start value with last result saved on history.
OverwriteDefaultFrom cannot be used with IsSecret
IControlInput 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
Styles(InputStyles, Style)
Overwrite Styles
IControlInput Styles(InputStyles styletype, Style value)
Parameters
styletype
InputStyles
InputStyles of content
Returns
SuggestionHandler(Func<SuggestionInput, SuggestionOutput>)
Add Suggestion Handler feature
SuggestionHandler cannot be used with IsSecret
IControlInput SuggestionHandler(Func<SuggestionInput, SuggestionOutput> value)
Parameters
value
Func<SuggestionInput, SuggestionOutput>
function to apply suggestions. SuggestionInput and SuggestionOutput
Returns
ValidateOnDemand(Boolean)
Execute validators foreach input
IControlInput ValidateOnDemand(bool value)
Parameters
value
Boolean
true execute validators foreach input; otherwise, only at finish.