示例#1
0
        /// <summary>
        /// Displays to the console the list of possible answers.
        /// </summary>
        protected virtual void DisplayPossibleAnswersList()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("[");

            string yesText = CapitalizeDefaultAnswer && DefaultAnswer == YesNoAnswer.Yes
                ? YesText.ToUpper()
                : YesText;

            sb.Append(yesText);

            sb.Append("/");

            string noText = CapitalizeDefaultAnswer && DefaultAnswer == YesNoAnswer.No
                ? NoText.ToUpper()
                : NoText;

            sb.Append(noText);

            if (AcceptCancel)
            {
                sb.Append("/");

                string cancelText = CapitalizeDefaultAnswer && DefaultAnswer == YesNoAnswer.Cancel
                    ? CancelText.ToUpper()
                    : CancelText;
                sb.Append(cancelText);
            }

            sb.Append("]");

            Console.Write(sb);
        }
示例#2
0
        /// <summary>
        /// Displays to the console the list of possible answers.
        /// </summary>
        protected virtual void DisplayPossibleAnswersList()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("[");

            string yesText = CapitalizeDefaultAnswer && DefaultAnswer == YesNoAnswer.Yes
                ? YesText.ToUpper()
                : YesText;

            sb.Append(yesText);

            sb.Append("/");

            string noText = CapitalizeDefaultAnswer && DefaultAnswer == YesNoAnswer.No
                ? NoText.ToUpper()
                : NoText;

            sb.Append(noText);

            if (AcceptCancel)
            {
                sb.Append("/");

                string cancelText = CapitalizeDefaultAnswer && DefaultAnswer == YesNoAnswer.Cancel
                    ? CancelText.ToUpper()
                    : CancelText;
                sb.Append(cancelText);
            }

            sb.Append("]");

            InlineTextBlock inlineTextBlock = new InlineTextBlock
            {
                Text            = sb.ToString(),
                ForegroundColor = ForegroundColor,
                BackgroundColor = BackgroundColor
            };

            inlineTextBlock.Display();
        }