private void DisplayQuestion() { InlineTextBlock labelControl = new InlineTextBlock { PaddingRight = 1, ForegroundColor = QuestionForegroundColor ?? ForegroundColor, BackgroundColor = QuestionBackgroundColor ?? BackgroundColor, Text = QuestionText }; labelControl.Display(); }
private void DisplaySpaceAfterQuestion() { string space = new string(' ', SpaceAfterQuestion); InlineTextBlock inlineTextBlock = new InlineTextBlock { Text = space, ForegroundColor = ForegroundColor, BackgroundColor = BackgroundColor }; inlineTextBlock.Display(); }
/// <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(); }