Class Console
Represents the standard console output stream.
Inheritance
System.Object
Console
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()
Assembly: Cosmos.System2.dll
Syntax
Constructors
|
Improve this Doc
View Source
Console(TextScreenBase)
Constructs a new instance of the Console class.
Declaration
public Console(TextScreenBase textScreen)
Parameters
Type |
Name |
Description |
TextScreenBase |
textScreen |
The device to direct text output to.
|
Fields
|
Improve this Doc
View Source
cX
The underlying Cached X cursor location field.
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
cY
The underlying Cached Y cursor location field
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
mText
Declaration
public TextScreenBase mText
Field Value
|
Improve this Doc
View Source
mX
The underlying X cursor location field.
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
mY
The underlying Y cursor location field.
Declaration
Field Value
Type |
Description |
System.Int32 |
|
Properties
|
Improve this Doc
View Source
Background
The background color of the displayed text.
Declaration
public ConsoleColor Background { get; set; }
Property Value
Type |
Description |
System.ConsoleColor |
|
|
Improve this Doc
View Source
CachedX
The text cached cursor location in the X (horizontal) axis.
Declaration
public int CachedX { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
CachedY
Declaration
public int CachedY { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Cols
Declaration
public int Cols { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
CursorSize
The size of the cursor, in the range of 1 to 100.
Declaration
public int CursorSize { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Exceptions
Type |
Condition |
System.ArgumentOutOfRangeException |
Thrown when trying to set value out of range.
|
|
Improve this Doc
View Source
CursorVisible
Get or sets the visibility of the cursor.
Declaration
public bool CursorVisible { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Foreground
The foreground color of the displayed text.
Declaration
public ConsoleColor Foreground { get; set; }
Property Value
Type |
Description |
System.ConsoleColor |
|
|
Improve this Doc
View Source
Rows
Declaration
public int Rows { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
X
The text cursor location in the X (horizontal) axis.
Declaration
public int X { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Y
Get and set cursor location on Y axis.
Declaration
public int Y { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
|
Improve this Doc
View Source
Clear()
Clears the console, and changes the cursor location to (0, 0).
Declaration
|
Improve this Doc
View Source
CreateOutputWriter(Stream)
Declaration
public TextWriter CreateOutputWriter(Stream outputStream)
Parameters
Type |
Name |
Description |
System.IO.Stream |
outputStream |
|
Returns
Type |
Description |
System.IO.TextWriter |
|
|
Improve this Doc
View Source
GetOrCreateReader()
Declaration
public TextReader GetOrCreateReader()
Returns
Type |
Description |
System.IO.TextReader |
|
|
Improve this Doc
View Source
IsStdErrorRedirected()
Declaration
public static bool IsStdErrorRedirected()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsStdInRedirected()
Declaration
public static bool IsStdInRedirected()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsStdOutRedirected()
Declaration
public static bool IsStdOutRedirected()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
OpenStandardError()
Declaration
public Stream OpenStandardError()
Returns
Type |
Description |
System.IO.Stream |
|
|
Improve this Doc
View Source
Declaration
public Stream OpenStandardInput()
Returns
Type |
Description |
System.IO.Stream |
|
|
Improve this Doc
View Source
OpenStandardOutput()
Declaration
public Stream OpenStandardOutput()
Returns
Type |
Description |
System.IO.Stream |
|
|
Improve this Doc
View Source
ReadKey(Boolean)
Declaration
public ConsoleKeyInfo ReadKey(bool intercept)
Parameters
Type |
Name |
Description |
System.Boolean |
intercept |
|
Returns
Type |
Description |
System.ConsoleKeyInfo |
|
|
Improve this Doc
View Source
ResetInternalStdIn()
Declaration
public void ResetInternalStdIn()
|
Improve this Doc
View Source
UpdateCursor()
Declaration
protected void UpdateCursor()
|
Improve this Doc
View Source
UpdateCursorFromCache()
Declaration
public void UpdateCursorFromCache()
|
Improve this Doc
View Source
Write(Byte)
Write char to the console.
Declaration
public void Write(byte aChar)
Parameters
Type |
Name |
Description |
System.Byte |
aChar |
A char to write
|
|
Improve this Doc
View Source
Write(Byte, Int32, Int32)
Write char to the console.
Declaration
public void Write(byte aChar, int left, int top)
Parameters
Type |
Name |
Description |
System.Byte |
aChar |
A char to write.
|
System.Int32 |
left |
X axis position.
|
System.Int32 |
top |
Y axis position.
|
|
Improve this Doc
View Source
Write(ReadOnlySpan<Byte>)
Writes the given sequence of ASCII characters in the form of a byte
array to the console.
Declaration
public void Write(ReadOnlySpan<byte> aText)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Byte> |
aText |
The byte array to write to the console.
|