Class TerminalSurface
Represents a screen-bound surface and contains all its functionality.
Inherited Members
Namespace: Sharpie
Assembly: sharpie.dll
Syntax
[PublicAPI]
public class TerminalSurface : Surface, IDisposable, ITerminalSurface, ISurface, IDrawSurface
Properties
ImmediateRefresh
Set or get the immediate refresh capability of the surface.
Declaration
public bool ImmediateRefresh { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Immediate refresh will make the surface redraw affected areas on each change.
This might be very slow for most use cases so the default is false
.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Surface is no longer usable. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
Terminal
The terminal this surface belongs to.
Declaration
public Terminal Terminal { get; }
Property Value
Type | Description |
---|---|
Terminal |
Methods
AssertSynchronized()
Asserts that executing thread is bound to the correct synchronization context.
Declaration
protected override void AssertSynchronized()
Overrides
Exceptions
Type | Condition |
---|---|
CursesSynchronizationException | Thrown if current thread is not bound to the correct context. |
Refresh()
Redraws all the dirty lines of the surface to the terminal. If AtomicRefresh() is active, all refreshes are batched together until the lock is released.
Declaration
public virtual void Refresh()
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Surface is no longer usable. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |
Refresh(int, int)
Redraws the given lines of the window to the terminal.
Declaration
public virtual void Refresh(int y, int count)
Parameters
Type | Name | Description |
---|---|---|
int | y | The starting line to refresh. |
int | count | The number of lines to refresh. |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
InvalidOperationException | Thrown if an atomic refresh is in progress. |
ObjectDisposedException | Window is no longer usable. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |