Esempio n. 1
0
 /// <summary>Gets the ANSI sequence to set all of the attribute, forground, and background colors.</summary>
 /// <param name="attribute">Which attribute to set.</param>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set all of the attribute, forground, and background colors.</returns>
 public static string SetTextAttributes(AnsiAttribute attribute, AnsiForegroundColor foregroundColor, AnsiBackgroundColor backgroundColor)
 {
     return(Esc + string.Format(
                "[{0};{1};{2}m",
                (int)attribute,
                (int)foregroundColor,
                (int)backgroundColor));
 }
Esempio n. 2
0
        public void Ctor_CharsetIsCorrect()
        {
            var target = new AnsiAttribute();

            target.CharSet.Should().Be(CharSet.Ansi);
        }
Esempio n. 3
0
 /// <summary>Gets the ANSI sequence to set the text attribute.</summary>
 /// <param name="attribute">Which attribute to set.</param>
 /// <returns>The ANSI sequence to set the text attribute.</returns>
 public static string SetTextAttributes(AnsiAttribute attribute)
 {
     return(Esc + string.Format("[{0}m", (int)attribute));
 }
Esempio n. 4
0
 /// <summary>Gets the ANSI sequence to set the text attribute.</summary>
 /// <param name="attribute">Which attribute to set.</param>
 /// <returns>The ANSI sequence to set the text attribute.</returns>
 public static string SetTextAttributes(AnsiAttribute attribute)
 {
     return($"{ESC}[{(int)attribute}m");
 }
Esempio n. 5
0
 /// <summary>Gets the ANSI sequence to set all of the attribute, forground, and background colors.</summary>
 /// <param name="attribute">Which attribute to set.</param>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set all of the attribute, forground, and background colors.</returns>
 public static string SetTextAttributes(AnsiAttribute attribute, AnsiForegroundColor foregroundColor, AnsiBackgroundColor backgroundColor)
 {
     return($"{ESC}[{(int)attribute};{(int)foregroundColor};{(int)backgroundColor}m");
 }
Esempio n. 6
0
 /// <summary>Gets the ANSI sequence to set the text attribute.</summary>
 /// <param name="attribute">Which attribute to set.</param>
 /// <returns>The ANSI sequence to set the text attribute.</returns>
 public static string SetTextAttributes(AnsiAttribute attribute)
 {
     return Esc + string.Format("[{0}m", (int)attribute);
 }
Esempio n. 7
0
 /// <summary>Gets the ANSI sequence to set all of the attribute, forground, and background colors.</summary>
 /// <param name="attribute">Which attribute to set.</param>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set all of the attribute, forground, and background colors.</returns>
 public static string SetTextAttributes(AnsiAttribute attribute, AnsiForegroundColor foregroundColor, AnsiBackgroundColor backgroundColor)
 {
     return Esc + string.Format(
         "[{0};{1};{2}m",
         (int)attribute,
         (int)foregroundColor,
         (int)backgroundColor);
 }