/// <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);
        }
예제 #2
0
 private void CreateControlDisplay()
 {
     ControlDisplay = new ControlDisplay
     {
         Layout          = Layout,
         ForegroundColor = ForegroundColor,
         BackgroundColor = BackgroundColor
     };
 }
예제 #3
0
        /// <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);
            }
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
        /// <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();
        }
예제 #6
0
        /// <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);
            }
        }
예제 #7
0
 /// <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);