Class Window
Represents a Curses window and contains all it's functionality.
Inherited Members
Namespace: Sharpie
Assembly: sharpie.dll
Syntax
[PublicAPI]
public sealed class Window : TerminalSurface, IDisposable, IWindow, ITerminalSurface, ISurface, IDrawSurface
Properties
Location
Gets or sets the location of the window within its parent.
Declaration
public Point Location { get; set; }
Property Value
| Type | Description |
|---|---|
| Point |
Remarks
This operation is not thread safe.
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | The |
| 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 occurred. |
Origin
Returns the value of Location.
Declaration
protected override Point Origin { get; }
Property Value
| Type | Description |
|---|---|
| Point |
Overrides
Exceptions
| Type | Condition |
|---|---|
| CursesOperationException | A Curses error occurred. |
Screen
The parent screen of this window.
Declaration
public Screen Screen { get; }
Property Value
| Type | Description |
|---|---|
| Screen |
Size
Gets or sets the size of the window.
Declaration
public Size Size { get; set; }
Property Value
| Type | Description |
|---|---|
| Size |
Remarks
This operation is not thread safe. The new size will be adjusted to match the parent's available space.
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | The |
| 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 occurred. |
SubWindows
Lists of children of this object.
Declaration
public IEnumerable<ISubWindow> SubWindows { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<ISubWindow> |
Remarks
This operation is not thread safe.
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | Window is no longer usable. |
| CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
Visible
Gets or sets the value indicating if the window is visible.
Declaration
public bool Visible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This operation is not thread safe.
Exceptions
| Type | Condition |
|---|---|
| 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 occurred. |
Methods
BringToFront()
Send the window to the front of the Z-order.
Declaration
public void BringToFront()
Remarks
This operation is not thread safe.
Exceptions
| Type | Condition |
|---|---|
| CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
| CursesOperationException | A Curses error occurred. |
Delete()
Deletes the surface from the curses backend.
Declaration
protected override void Delete()
Overrides
Duplicate()
Duplicates and existing window, including its attributes.
Declaration
public IWindow Duplicate()
Returns
| Type | Description |
|---|---|
| IWindow | A new window object. |
Remarks
This operation is not thread safe.
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | Screen 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 occurred. |
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 override void Refresh()
Overrides
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 occurred. |
| CursesOperationException | A Curses error occurred. |
Refresh(int, int)
Redraws the given lines of the window to the terminal.
Declaration
public override 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. |
Overrides
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 occurred. |
| CursesOperationException | A Curses error occurred. |
SendToBack()
Send the window to the back of the Z-order.
Declaration
public void SendToBack()
Remarks
This operation is not thread safe.
Exceptions
| Type | Condition |
|---|---|
| CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
| CursesOperationException | A Curses error occurred. |
SubWindow(Rectangle)
Creates a new sub-window in the parent window.
Declaration
public ISubWindow SubWindow(Rectangle area)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | area | The area of the window to put the sub-window in. |
Returns
| Type | Description |
|---|---|
| ISubWindow | A new window object. |
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | Screen is no longer usable. |
| ArgumentOutOfRangeException | The |
| CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
| CursesOperationException | A Curses error occurred. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |