/// <summary> /// Displays the horixontal line. /// </summary> protected override void DoDisplayContent(ControlDisplay display) { int actualContentWidth = Layout.ActualContentWidth; string text = new string(Character, actualContentWidth); display.WriteRow(text); }
private void CreateControlDisplay() { ControlDisplay = new ControlDisplay { Layout = Layout, ForegroundColor = ForegroundColor, BackgroundColor = BackgroundColor }; }
/// <summary> /// Displays the lines of text together with the left and right margins. /// </summary> protected override void DoDisplayContent(ControlDisplay display) { if (Text == null) { return; } IEnumerable <string> chunks = Text.GetLines(Layout.ActualContentWidth); foreach (string chunk in chunks) { display.WriteRow(chunk); } }
private void WriteBottomPadding() { if (Layout.PaddingBottom <= 0) { return; } string text = new string(' ', Layout.ActualContentWidth); for (int i = 0; i < Layout.PaddingBottom; i++) { ControlDisplay.WriteRow(text); } }
/// <summary> /// Displays the margins and the content of the control. /// It also ensures that the control is displayed starting from a new line. /// </summary> protected override void DoDisplay() { MoveToNextLineIfNecessary(); CalculateLayout(); controlDisplay = CreateControlDisplay(); WriteTopMargin(); WriteTopPadding(); DoDisplayContent(controlDisplay); WriteBottomPadding(); WriteBottomMargin(); }
/// <summary> /// Displays the pause text and waits for the user to press a key. /// </summary> protected override void DoDisplayContent(ControlDisplay display) { if (Text == null) { return; } lastLineLength = 0; IEnumerable <string> lines = Text.GetLines(Layout.ActualContentWidth); foreach (string line in lines) { lastLineLength = line.Length; display.WriteRow(line); } }
/// <summary> /// When implemented by an inheritor it displays the content of the control to the console. /// </summary> protected abstract void DoDisplayContent(ControlDisplay display);
/// <summary> /// When implemented by an inheritor it displays the content of the control to the console. /// The inheritor must also calculate and set the <see cref="InnerSize"/> proeprty. /// </summary> protected abstract override void DoDisplayContent(ControlDisplay display);