Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Menu"/> class.
        /// </summary>
        /// <param name="ioStreamSet">The IO streams.</param>
        /// <param name="prompt">The prompt to display at the top of the menu.</param>
        /// <param name="options">The options to present.</param>
        public Menu(IOStreamSet ioStreamSet, string prompt, params Option[] options)
        {
            ArgCheck.NotNull(ioStreamSet, nameof(ioStreamSet));
            ArgCheck.NotEmpty(prompt, nameof(prompt));
            ArgCheck.NotEmpty(options, nameof(options));

            this.IO      = ioStreamSet;
            this.Prompt  = prompt;
            this.Options = options;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConfirmationPrompt"/> class.
        /// </summary>
        /// <param name="ioStreamSet">The IO streams.</param>
        /// <param name="confirmationDetails">The details to confirm.</param>
        public ConfirmationPrompt(
            IOStreamSet ioStreamSet,
            string confirmationDetails)
        {
            ArgCheck.NotNull(ioStreamSet, nameof(ioStreamSet));
            ArgCheck.NotEmpty(confirmationDetails, nameof(confirmationDetails));

            this.IO = ioStreamSet;
            this.ConfirmationDetails = confirmationDetails;
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InputPrompt"/> class.
        /// </summary>
        /// <param name="ioStreamSet">The IO streams.</param>
        /// <param name="prompt">The prompt to display.</param>
        /// <param name="isConfidentialInput">
        /// Whether or not the input is confidential. If so, the input is not displayed as it is typed on the console.
        /// </param>
        /// <param name="options">An optional value validator.</param>
        public InputPrompt(
            IOStreamSet ioStreamSet,
            string prompt,
            bool isConfidentialInput      = false,
            Func <string, bool> validator = null)
        {
            ArgCheck.NotNull(ioStreamSet, nameof(ioStreamSet));
            ArgCheck.NotEmpty(prompt, nameof(prompt));

            this.IO     = ioStreamSet;
            this.Prompt = prompt;
            this.IsConfidentialInput = isConfidentialInput;
            this.Validator           = validator;
        }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SecretSelector"/> class.
        /// </summary>
        /// <param name="ioStreamSet">The IO streams.</param>
        public SecretSelector(IOStreamSet ioStreamSet)
        {
            ArgCheck.NotNull(ioStreamSet, nameof(ioStreamSet));

            this.IO = ioStreamSet;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PasswordEntryInterface"/> class.
        /// </summary>
        /// <param name="ioStreamSet">The IO streams.</param>
        public PasswordEntryInterface(IOStreamSet ioStreamSet)
        {
            ArgCheck.NotNull(ioStreamSet, nameof(ioStreamSet));

            this.IO = ioStreamSet;
        }