Skip to main content

Definition

Assembly: Breakdance.Tools.dll Namespace: CloudNimble.Breakdance.Tools Inheritance: System.Object

Syntax

CloudNimble.Breakdance.Tools.ColorConsole

Summary

Console Color Helper class that provides coloring to individual commands

Methods

Write

Write with color

Syntax

public static void Write(string text, System.Nullable<System.ConsoleColor> color = null)

Parameters

NameTypeDescription
textstring-
colorSystem.Nullable<System.ConsoleColor>-

Write

Writes out a line with color specified as a string

Syntax

public static void Write(string text, string color)

Parameters

NameTypeDescription
textstringText to write
colorstringA console color. Must match ConsoleColors collection names (case insensitive)

WriteEmbeddedColorLine

Allows a string to be written with embedded color values using: This is [red]Red[/red] text and this is [cyan]Blue[/cyan] text

Syntax

public static void WriteEmbeddedColorLine(string text, System.Nullable<System.ConsoleColor> baseTextColor = null)

Parameters

NameTypeDescription
textstringText to display
baseTextColorSystem.Nullable<System.ConsoleColor>Base text color

WriteError

Write a Error Line - Red

Syntax

public static void WriteError(string text)

Parameters

NameTypeDescription
textstringText to write out

WriteInfo

Write a Info Line - dark cyan

Syntax

public static void WriteInfo(string text)

Parameters

NameTypeDescription
textstringText to write out

WriteLine

WriteLine with color

Syntax

public static void WriteLine(string text, System.Nullable<System.ConsoleColor> color = null)

Parameters

NameTypeDescription
textstring-
colorSystem.Nullable<System.ConsoleColor>-

WriteLine

Writes out a line with a specific color as a string

Syntax

public static void WriteLine(string text, string color)

Parameters

NameTypeDescription
textstringText to write
colorstringA console color. Must match ConsoleColors collection names (case insensitive)

WriteSuccess

Write a Success Line - green

Syntax

public static void WriteSuccess(string text)

Parameters

NameTypeDescription
textstringText to write out

WriteWarning

Write a Warning Line - Yellow

Syntax

public static void WriteWarning(string text)

Parameters

NameTypeDescription
textstringText to Write out

WriteWrappedHeader

Writes a line of header text wrapped in a in a pair of lines of dashes:

Header Text

and allows you to specify a color for the header. The dashes are colored

Syntax

public static void WriteWrappedHeader(string headerText, char wrapperChar = '-', System.ConsoleColor headerColor = 14, System.ConsoleColor dashColor = 8)

Parameters

NameTypeDescription
headerTextstringHeader text to display
wrapperCharcharwrapper character (-)
headerColorSystem.ConsoleColorColor for header text (yellow)
dashColorSystem.ConsoleColorColor for dashes (gray)