C# Class Pastel.ConsoleExtensions

Controls colored console output by .
Afficher le fichier Open project: Invenietis/CK-Monitoring

Méthodes publiques

Méthode Description
Disable ( ) : void

Disables any future console color output produced by Pastel.

Enable ( ) : void

Enables any future console color output produced by Pastel.

FromColor ( ConsoleColor c ) : Color

Convert a ConsoleColor to a Color.

Pastel ( string input, Color color ) : string

Returns a string wrapped in an ANSI foreground color code using the specified color.

Pastel ( string input, ConsoleColor color ) : string

Returns a string wrapped in an ANSI foreground color code using the specified color.

Pastel ( string input, string hexColor ) : string

Returns a string wrapped in an ANSI foreground color code using the specified color.

PastelBg ( string input, Color color ) : string

Returns a string wrapped in an ANSI background color code using the specified color.

PastelBg ( string input, ConsoleColor color ) : string

Returns a string wrapped in an ANSI background color code using the specified color.

PastelBg ( string input, string hexColor ) : string

Returns a string wrapped in an ANSI background color code using the specified color.

Private Methods

Méthode Description
CloseNestedPastelStrings ( string input, Color color, ColorPlane colorPlane ) : string
ConsoleExtensions ( ) : System
GetConsoleMode ( IntPtr hConsoleHandle, uint &lpMode ) : bool
GetStdHandle ( int nStdHandle ) : IntPtr
SetConsoleMode ( IntPtr hConsoleHandle, uint dwMode ) : bool

Method Details

Disable() public static méthode

Disables any future console color output produced by Pastel.
public static Disable ( ) : void
Résultat void

Enable() public static méthode

Enables any future console color output produced by Pastel.
public static Enable ( ) : void
Résultat void

FromColor() public static méthode

Convert a ConsoleColor to a Color.
public static FromColor ( ConsoleColor c ) : Color
c ConsoleColor
Résultat Color

Pastel() public static méthode

Returns a string wrapped in an ANSI foreground color code using the specified color.
public static Pastel ( string input, Color color ) : string
input string The string to color.
color Color The color to use on the specified string.
Résultat string

Pastel() public static méthode

Returns a string wrapped in an ANSI foreground color code using the specified color.
public static Pastel ( string input, ConsoleColor color ) : string
input string The string to color.
color ConsoleColor The color to use on the specified string.
Résultat string

Pastel() public static méthode

Returns a string wrapped in an ANSI foreground color code using the specified color.
public static Pastel ( string input, string hexColor ) : string
input string The string to color.
hexColor string The color to use on the specified string.Supported format: [#]RRGGBB.
Résultat string

PastelBg() public static méthode

Returns a string wrapped in an ANSI background color code using the specified color.
public static PastelBg ( string input, Color color ) : string
input string The string to color.
color Color The color to use on the specified string.
Résultat string

PastelBg() public static méthode

Returns a string wrapped in an ANSI background color code using the specified color.
public static PastelBg ( string input, ConsoleColor color ) : string
input string The string to color.
color ConsoleColor The color to use on the specified string.
Résultat string

PastelBg() public static méthode

Returns a string wrapped in an ANSI background color code using the specified color.
public static PastelBg ( string input, string hexColor ) : string
input string The string to color.
hexColor string The color to use on the specified string.Supported format: [#]RRGGBB.
Résultat string