Class Console
Represents the standard console output stream.
Inheritance
Inherited Members
Namespace: Cosmos.System
Assembly: Cosmos.System2.dll
Syntax
public class Console
Constructors
| Improve this Doc View SourceConsole(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 SourcemText
Text screen.
Declaration
public TextScreenBase mText
Field Value
Type | Description |
---|---|
TextScreenBase |
mX
The underlying X cursor location field.
Declaration
protected int mX
Field Value
Type | Description |
---|---|
System.Int32 |
mY
The underlying Y cursor location field.
Declaration
protected int mY
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
| Improve this Doc View SourceBackground
The background color of the displayed text.
Declaration
public ConsoleColor Background { get; set; }
Property Value
Type | Description |
---|---|
System.ConsoleColor |
Cols
Get window width.
Declaration
public int Cols { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
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. |
CursorVisible
Get or sets the visibility of the cursor.
Declaration
public bool CursorVisible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Foreground
The foreground color of the displayed text.
Declaration
public ConsoleColor Foreground { get; set; }
Property Value
Type | Description |
---|---|
System.ConsoleColor |
Rows
Get window height.
Declaration
public int Rows { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
X
The text cursor location in the X (horizontal) axis.
Declaration
public int X { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
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 SourceClear()
Clears the console, and changes the cursor location to (0, 0).
Declaration
public void Clear()
UpdateCursor()
Update cursor position.
Declaration
protected void UpdateCursor()
Write(Byte)
Write char to the console.
Declaration
public void Write(byte aChar)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | aChar | A char to write |
Write(Byte[])
Writes the given sequence of ASCII characters in the form of a byte array to the console.
Declaration
public void Write(byte[] aText)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | aText | The byte array to write to the console. |