Class Console
A surface that has a cursor.
Implements
Inherited Members
Namespace: SadConsole
Assembly: SadConsole.dll
Syntax
[DataContract]
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class Console : ScreenSurface, IDisposable, IScreenSurfaceEditable, IScreenSurface, IScreenObject, IPositionable, IComponentHost, ISurface, ISurfaceSettable
Constructors
Console(ICellSurface, IFont?, Point?)
Creates a new console using the existing surface.
Declaration
public Console(ICellSurface surface, IFont? font = null, Point? fontSize = null)
Parameters
Type | Name | Description |
---|---|---|
ICellSurface | surface | The surface. |
IFont | font | The font to use with the surface. |
Point? | fontSize | The font size. |
Console(int, int)
Creates a new console.
Declaration
public Console(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
int | width | The width in cells of the surface. |
int | height | The height in cells of the surface. |
Console(int, int, ColoredGlyphBase[])
Creates a new screen object that can render a surface. Uses the specified cells to generate the surface.
Declaration
public Console(int width, int height, ColoredGlyphBase[] initialCells)
Parameters
Type | Name | Description |
---|---|---|
int | width | The width in cells of the surface. |
int | height | The height in cells of the surface. |
ColoredGlyphBase[] | initialCells | The initial cells to seed the surface. |
Console(int, int, int, int)
Creates a new console with the specified width and height, with Transparent for the background and White for the foreground.
Declaration
public Console(int width, int height, int bufferWidth, int bufferHeight)
Parameters
Type | Name | Description |
---|---|---|
int | width | The visible width of the console in cells. |
int | height | The visible height of the console in cells. |
int | bufferWidth | The total width of the console in cells. |
int | bufferHeight | The total height of the console in cells. |
Console(int, int, int, int, ColoredGlyphBase[]?)
Creates a console with the specified width and height, with Transparent for the background and White for the foreground.
Declaration
public Console(int width, int height, int bufferWidth, int bufferHeight, ColoredGlyphBase[]? initialCells)
Parameters
Type | Name | Description |
---|---|---|
int | width | The width of the console in cells. |
int | height | The height of the console in cells. |
int | bufferWidth | The total width of the console in cells. |
int | bufferHeight | The total height of the console in cells. |
ColoredGlyphBase[] | initialCells | The cells to seed the console with. If null, creates the cells for you. |
Properties
AutoCursorOnFocus
Toggles the cursor as visible\hidden when the console if focused\unfocused.
Declaration
[DataMember]
public bool AutoCursorOnFocus { get; set; }
Property Value
Type | Description |
---|---|
bool |
Cursor
The virtual cursor reference.
Declaration
public Cursor Cursor { get; protected set; }
Property Value
Type | Description |
---|---|
Cursor |
Methods
OnFocusLost()
Called when this console's focus has been lost. Hides the Cursor if AutoCursorOnFocus is true.
Declaration
public override void OnFocusLost()
Overrides
OnFocused()
Called when this console is focused. Shows the Cursor if AutoCursorOnFocus is true.
Declaration
public override void OnFocused()
Overrides
OnVisibleChanged()
Called when the visibility of the object changes.
Declaration
protected override void OnVisibleChanged()
Overrides
ToString()
Returns the value "Console".
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The string "Console". |