Exemple #1
0
 /// <summary>
 ///     Write a horizontal formated line to the buffer
 /// </summary>
 public void HorizontalString()
 {
     for (var x = 1; x <= Console.WindowWidth; x++)
     {
         Write(RuleChar.ToString(), (x % 2).Equals(0) ? RuleOffColor : RuleOnColor);
     }
 }
Exemple #2
0
        /// <summary>
        ///     header lines are used to help format WriteHeader
        ///     RuleChar(RuleCharOff) Padding text Padding RuleChar(RuleCharOn)
        /// </summary>
        /// <param name="text">Text to be formated</param>
        /// <param name="color">ConsoleColor of text</param>
        /// <param name="center">Should the text be centered? default is yes</param>
        public void WriteAHeaderString(string text, ConsoleColor color, bool center = true)
        {
            Write(RuleChar.ToString(), RuleOnColor);
            var output = center ? Helpers.CenteredString(text, -1) : text;

            Write(output, color);
            Write(RuleChar.ToString().PadLeft((Console.WindowWidth - output.Length) - 1), RuleOnColor);
        }