C# Class llbc.SafeConsole

The safe console class simple encapsulation.
Datei anzeigen Open project: lailongwei/llbc Class Usage Examples

Public Methods

Method Description
Flush ( ) : void

Flush all standard output buffer to console.

FlushError ( ) : void

Flush all standard error buffer to console.

Read ( ) : int

Read next character from input stream.

wrapped from Console.Read() method

ReadKey ( ) : ConsoleKeyInfo

Get user press key info.

wrapped from Console.ReadKey() method

ReadKey ( bool intercept ) : ConsoleKeyInfo

Read user press key info.

ResetColor ( ) : void

Reset console color.

Trace ( string msg ) : void

Trace message, only output when enabled LLBC_DEBUG macro in llbc core library.

Write ( bool value ) : void

Write bool value to standard output console.

Write ( char value ) : void

Write char value to standard output console.

Write ( object value ) : void

Write object value to standard output console.

Write ( string fmt ) : void

Format output specific datas to standard output console.

WriteError ( bool value ) : void

Write bool value to standard error console.

WriteError ( char value ) : void

Write char value to standard error console.

WriteError ( object value ) : void

Write object value to standard error console.

WriteError ( string fmt ) : void

Format output specific datas to standard error console.

WriteErrorLine ( bool value ) : void

Write bool value to standard error console and append LF character.

WriteErrorLine ( char value ) : void

Write char value to standard error console and append LF character.

WriteErrorLine ( object value ) : void

Write object value to standard error console and append LF character.

WriteErrorLine ( string fmt ) : void

Format output specific datas to standard error console and append LF character.

WriteLine ( bool value ) : void

Write bool value to standard output console and append LF character.

WriteLine ( char value ) : void

Write char value to standard output console and append LF character.

WriteLine ( object value ) : void

Write object value to standard output console and append LF character.

WriteLine ( string fmt ) : void

Format output specific datas to standard output console and append LF character.

_Write ( bool toStdout, bool newLine, string fmt ) : void

Private Methods

Method Description
_SafeOutput ( bool toStdout, bool newLine, string content ) : void
_Write ( bool toStdout, bool newLine, bool value ) : void
_Write ( bool toStdout, bool newLine, char value ) : void
_Write ( bool toStdout, bool newLine, object value ) : void

Method Details

Flush() public static method

Flush all standard output buffer to console.
public static Flush ( ) : void
return void

FlushError() public static method

Flush all standard error buffer to console.
public static FlushError ( ) : void
return void

Read() public static method

Read next character from input stream.

wrapped from Console.Read() method

public static Read ( ) : int
return int

ReadKey() public static method

Get user press key info.

wrapped from Console.ReadKey() method

public static ReadKey ( ) : ConsoleKeyInfo
return System.ConsoleKeyInfo

ReadKey() public static method

Read user press key info.
public static ReadKey ( bool intercept ) : ConsoleKeyInfo
intercept bool Determines whether to display the pressed key in the console window. true to not display the pressed key; otherwise, false
return System.ConsoleKeyInfo

ResetColor() public static method

Reset console color.
public static ResetColor ( ) : void
return void

Trace() public static method

Trace message, only output when enabled LLBC_DEBUG macro in llbc core library.
public static Trace ( string msg ) : void
msg string will trace message
return void

Write() public static method

Write bool value to standard output console.
public static Write ( bool value ) : void
value bool bool value
return void

Write() public static method

Write char value to standard output console.
public static Write ( char value ) : void
value char char value
return void

Write() public static method

Write object value to standard output console.
public static Write ( object value ) : void
value object object value
return void

Write() public static method

Format output specific datas to standard output console.
public static Write ( string fmt ) : void
fmt string format string
return void

WriteError() public static method

Write bool value to standard error console.
public static WriteError ( bool value ) : void
value bool bool value
return void

WriteError() public static method

Write char value to standard error console.
public static WriteError ( char value ) : void
value char char value
return void

WriteError() public static method

Write object value to standard error console.
public static WriteError ( object value ) : void
value object object value
return void

WriteError() public static method

Format output specific datas to standard error console.
public static WriteError ( string fmt ) : void
fmt string format string
return void

WriteErrorLine() public static method

Write bool value to standard error console and append LF character.
public static WriteErrorLine ( bool value ) : void
value bool bool value
return void

WriteErrorLine() public static method

Write char value to standard error console and append LF character.
public static WriteErrorLine ( char value ) : void
value char char value
return void

WriteErrorLine() public static method

Write object value to standard error console and append LF character.
public static WriteErrorLine ( object value ) : void
value object object value
return void

WriteErrorLine() public static method

Format output specific datas to standard error console and append LF character.
public static WriteErrorLine ( string fmt ) : void
fmt string format string
return void

WriteLine() public static method

Write bool value to standard output console and append LF character.
public static WriteLine ( bool value ) : void
value bool bool value
return void

WriteLine() public static method

Write char value to standard output console and append LF character.
public static WriteLine ( char value ) : void
value char char value
return void

WriteLine() public static method

Write object value to standard output console and append LF character.
public static WriteLine ( object value ) : void
value object object value
return void

WriteLine() public static method

Format output specific datas to standard output console and append LF character.
public static WriteLine ( string fmt ) : void
fmt string format string
return void

_Write() public static method

public static _Write ( bool toStdout, bool newLine, string fmt ) : void
toStdout bool
newLine bool
fmt string
return void