Skip to the content.

PromptPlus API:IControlAutoComplete

Build Publish License NuGet Downloads

Back to List Api

IControlAutoComplete

Namespace: PPlus.Controls

Represents the interface with all Methods of the AutoComplete control

public interface IControlAutoComplete : 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.

IControlAutoComplete AcceptInput(Func<Char, Boolean> value)

Parameters

value Func<Char, Boolean>
function to accept

Returns

IControlAutoComplete

AddValidators(params Func<Object, ValidationResult>[])

Add a validator to accept sucessfull finish of control.
Tip: see to validators embedding

IControlAutoComplete AddValidators(params Func<Object, ValidationResult>[] validators)

Parameters

validators Func<Object, ValidationResult>[]
the function validator.

Returns

IControlAutoComplete

ChangeDescription(Func<String, String>)

Dynamically change the description using a user role

IControlAutoComplete ChangeDescription(Func<String, String> value)

Parameters

value Func<String, String>
function to apply change

Returns

IControlAutoComplete

CompletionAsyncService(Func<String, Int32, CancellationToken, Task<String[]>>)

The function to execute autocomplete. This function is requeried to run!
First param is a current text input
Second param is current cursor postion at text input
third parameter is the control cancellation token

IControlAutoComplete CompletionAsyncService(Func<String, Int32, CancellationToken, Task<String[]>> value)

Parameters

value Func<String, Int32, CancellationToken, Task<String[]>>
function to autocomplete

Returns

IControlAutoComplete

CompletionMaxCount(Int32)

The max.items to return from function autocomplete.The value must be greater than or equal to 1

IControlAutoComplete CompletionMaxCount(int value)

Parameters

value Int32
Number of max.items

Returns

IControlAutoComplete

CompletionWaitToStart(Int32)

Number of mileseconds to wait before to start function autocomplete
Default value : 1000. The value must be greater than or equal to 100.

IControlAutoComplete CompletionWaitToStart(int value)

Parameters

value Int32
Number of mileseconds

Returns

IControlAutoComplete

Config(Action<IPromptConfig>)

Custom config the control.

IControlAutoComplete Config(Action<IPromptConfig> context)

Parameters

context Action<IPromptConfig>
action to apply changes. IPromptConfig

Returns

IControlAutoComplete

Default(String)

Default value when stated.

IControlAutoComplete Default(string value)

Parameters

value String
Value default

Returns

IControlAutoComplete

DefaultIfEmpty(String)

Default value when finished value is empty.

IControlAutoComplete DefaultIfEmpty(string value)

Parameters

value String
Finished value default

Returns

IControlAutoComplete

InputToCase(CaseOptions)

Transform char input using CaseOptions.

IControlAutoComplete InputToCase(CaseOptions value)

Parameters

value CaseOptions
Transform option

Returns

IControlAutoComplete

MaxLength(UInt16)

MaxLength of input text.The value must be greater than or equal to 1
Default value is 0 (no limit)

IControlAutoComplete MaxLength(ushort value)

Parameters

value UInt16
Length

Returns

IControlAutoComplete

MinimumPrefixLength(Int32)

Number minimum of chars to accept autocomplete
Default value : 3.The value must be greater than or equal to 1

IControlAutoComplete MinimumPrefixLength(int value)

Parameters

value Int32
Number of chars

Returns

IControlAutoComplete

OverwriteDefaultFrom(String, Nullable<TimeSpan>)

Overwrite default start value with last result saved on history.

IControlAutoComplete 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

IControlAutoComplete

PageSize(Int32)

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

IControlAutoComplete PageSize(int value)

Parameters

value Int32
Number of Max.items

Returns

IControlAutoComplete

Spinner(SpinnersType, Nullable<Int32>, IEnumerable<String>)

Overwrite SpinnersType. Default value is SpinnersType.Ascii
When use custom spinner, if has unicode values console does not support it, the rendering may not be as expected

IControlAutoComplete Spinner(SpinnersType spinnersType, Nullable<Int32> speedAnimation, IEnumerable<String> customspinner)

Parameters

spinnersType SpinnersType
The SpinnersType

speedAnimation Nullable<Int32>
Number of mileseconds foreach iteration of spinner. Valid only to SpinnersType.custom, otherwise will be ignored

customspinner IEnumerable<String>
IEnumerable values for custom spinner. Valid only to SpinnersType.custom, otherwise will be ignored

Returns

IControlAutoComplete

Styles(AutoCompleteStyles, Style)

Overwrite Styles

IControlAutoComplete Styles(AutoCompleteStyles styletype, Style value)

Parameters

styletype AutoCompleteStyles
AutoCompleteStyles of content

value Style
The Style

Returns

IControlAutoComplete

ValidateOnDemand(Boolean)

Execute validators foreach input

IControlAutoComplete ValidateOnDemand(bool value)

Parameters

value Boolean
true execute validators foreach input; otherwise, only at finish.

Returns

IControlAutoComplete


Back to List Api