PromptPlus API:IControlKeyPress
IControlKeyPress
Namespace: PPlus.Controls
Represents the interface with all Methods of the KeyPress control
public interface IControlKeyPress : IPromptControls<ConsoleKeyInfo>
Implements IPromptControls<ConsoleKeyInfo>
Methods
AddKeyValid(ConsoleKey, Nullable<ConsoleModifiers>)
Add Key and Modifiers valids for keypress
IControlKeyPress AddKeyValid(ConsoleKey key, Nullable<ConsoleModifiers> modifiers)
Parameters
key
ConsoleKey
Key
modifiers
Nullable<ConsoleModifiers>
Modifiers
Returns
Config(Action<IPromptConfig>)
Custom config the control.
IControlKeyPress Config(Action<IPromptConfig> context)
Parameters
context
Action<IPromptConfig>
action to apply changes. IPromptConfig
Returns
Spinner(SpinnersType, Nullable<Int32>, IEnumerable<String>)
Overwrite SpinnersType. ValueResult value is SpinnersType.Ascii
When use custom spinner, if has unicode values console does not support it, the rendering may not be as expected.
IControlKeyPress 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 value for custom spinner. Valid only to SpinnersType.custom, otherwise will be ignored
Returns
Styles(KeyPressStyles, Style)
Overwrite Styles
IControlKeyPress Styles(KeyPressStyles styletype, Style value)
Parameters
styletype
KeyPressStyles
KeyPressStyles of content
Returns
TextKeyValid(Func<ConsoleKeyInfo, String>)
Overwrite default ConsoleKey string to custom string.
When return null value the control use defaut string
IControlKeyPress TextKeyValid(Func<ConsoleKeyInfo, String> value)
Parameters
value
Func<ConsoleKeyInfo, String>
Transform function. When return null value the control use defaut string