Class ConsoleUtils
Provides various console-helper utilities
Inheritance
System.Object
ConsoleUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Azos.IO
Assembly: Azos.dll
Syntax
public static class ConsoleUtils
Methods
Error(String, Int32)
Shows message with colored error header
Declaration
public static void Error(string msg, int ln = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | msg | |
System.Int32 | ln |
Info(String, Int32)
Shows message with colored info header
Declaration
public static void Info(string msg, int ln = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | msg | |
System.Int32 | ln |
ReadPassword(Char)
Reads password from console displaying substitute characters instead of real ones
Declaration
public static string ReadPassword(char substitute)
Parameters
Type | Name | Description |
---|---|---|
System.Char | substitute |
Returns
Type | Description |
---|---|
System.String |
ReadPasswordToSecureBuffer(Char)
Reads password from console displaying substitute characters instead of real ones into a sealed SecureBuffer
Declaration
public static SecureBuffer ReadPasswordToSecureBuffer(char substitute)
Parameters
Type | Name | Description |
---|---|---|
System.Char | substitute |
Returns
Type | Description |
---|---|
SecureBuffer |
Warning(String, Int32)
Shows message with colored warning header
Declaration
public static void Warning(string msg, int ln = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | msg | |
System.Int32 | ln |
WriteMarkupContent(String)
Outputs colored text from content supplied in an HTML-like grammar:
Declaration
public static void WriteMarkupContent(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content |
WriteMarkupContent(String, Char, Char)
Outputs colored text from content supplied in an HTML-like grammar
Declaration
public static void WriteMarkupContent(string content, char open, char close)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | |
System.Char | open | |
System.Char | close |
WriteMarkupContentAsHTML(Stream, String, Encoding, Char, Char, String, String, String, ConsoleColor, ConsoleColor)
Declaration
public static void WriteMarkupContentAsHTML(Stream output, string content, Encoding encoding = null, char open = '<', char close = '>', string mkpPRE = "pre", string mkpCssForeColorPrefix = "conForeColor_", string mkpCssBackColorPrefix = "conBackColor_", ConsoleColor defaultForeColor = ConsoleColor.White, ConsoleColor defaultBackColor = ConsoleColor.Black)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | output | |
System.String | content | |
System.Text.Encoding | encoding | |
System.Char | open | |
System.Char | close | |
System.String | mkpPRE | |
System.String | mkpCssForeColorPrefix | |
System.String | mkpCssBackColorPrefix | |
System.ConsoleColor | defaultForeColor | |
System.ConsoleColor | defaultBackColor |
WriteMarkupContentAsHTML(TextWriter, String, Encoding, Char, Char, String, String, String, ConsoleColor, ConsoleColor)
Declaration
public static void WriteMarkupContentAsHTML(TextWriter output, string content, Encoding encoding = null, char open = '<', char close = '>', string mkpPRE = "pre", string mkpCssForeColorPrefix = "conForeColor_", string mkpCssBackColorPrefix = "conBackColor_", ConsoleColor defaultForeColor = ConsoleColor.White, ConsoleColor defaultBackColor = ConsoleColor.Black)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextWriter | output | |
System.String | content | |
System.Text.Encoding | encoding | |
System.Char | open | |
System.Char | close | |
System.String | mkpPRE | |
System.String | mkpCssForeColorPrefix | |
System.String | mkpCssBackColorPrefix | |
System.ConsoleColor | defaultForeColor | |
System.ConsoleColor | defaultBackColor |
WriteMarkupContentAsHTML(String, Encoding, Char, Char, String, String, String, ConsoleColor, ConsoleColor)
Declaration
public static string WriteMarkupContentAsHTML(string content, Encoding encoding = null, char open = '<', char close = '>', string mkpPRE = "pre", string mkpCssForeColorPrefix = "conForeColor_", string mkpCssBackColorPrefix = "conBackColor_", ConsoleColor defaultForeColor = ConsoleColor.White, ConsoleColor defaultBackColor = ConsoleColor.Black)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | |
System.Text.Encoding | encoding | |
System.Char | open | |
System.Char | close | |
System.String | mkpPRE | |
System.String | mkpCssForeColorPrefix | |
System.String | mkpCssBackColorPrefix | |
System.ConsoleColor | defaultForeColor | |
System.ConsoleColor | defaultBackColor |
Returns
Type | Description |
---|---|
System.String |