Provides helpers to prompt users.
Default constructor
public Void Interactive()
Collect password data without echoing to the console.
protected String CollectPassword()
Promps the user for text.
protected String Prompt(prompt, defaultValue)
Name | Type | Summary |
---|---|---|
prompt | String | Prompt message. |
defaultValue | String | Default value if nothing is entered. |
Prompts the user for an integer value.
public Int32 PromptInt(defaultValue, prompt, invalidMessage, minValue, maxValue)
Name | Type | Summary |
---|---|---|
defaultValue | Nullable<Int32> | Default value if nothing is entered. |
prompt | String | Prompt message. |
invalidMessage | String | Invalid message. |
minValue | Int32 | Minimum allowed value. |
maxValue | Int32 | Maximim allowed value. |
Prompt the user for an option.
public String PromptOption(defaultValue, options, prompt, invalidMessage, allowEmpty)
Name | Type | Summary |
---|---|---|
defaultValue | Char | Default value if nothing is entered. |
options | Char[] | Allowed options. |
prompt | String | Prompt message. |
invalidMessage | String | Invalid message. |
allowEmpty | Boolean | Whether an empty result is valid. |
Prompt the user for a password.
public String PromptPassword(defaultValue, prompt, promptConfirm, invalidMessage, invalidConfirmMessage, allowEmpty)
Name | Type | Summary |
---|---|---|
defaultValue | String | Default value if nothing is entered. |
prompt | String | Prompt message. |
promptConfirm | String | Confirmation prompt message. |
invalidMessage | String | Invalid message. |
invalidConfirmMessage | String | Invalid message for confirmation. |
allowEmpty | Boolean | Whether an empty result is valid. |
Prompts the user for a text.
public String PromptString(defaultValue, prompt, invalidMessage, allowEmpty)
Name | Type | Summary |
---|---|---|
defaultValue | String | Default value if nothing is entered. |
prompt | String | Prompt message. |
invalidMessage | String | Invalid message. |
allowEmpty | Boolean | Whether an empty result is valid. |
Writes the message to the console.
protected Void WriteInvalidMessage(message)
Name | Type | Summary |
---|---|---|
message | String | Message to write. |