Class SoftLabelKeyManager
Adds support for soft function keys.
Implements
Inherited Members
Namespace: Sharpie
Assembly: sharpie.dll
Syntax
[PublicAPI]
public sealed class SoftLabelKeyManager : ISoftLabelKeyManager
Properties
ColorMixture
Gets or sets the color mixture of the window.
Declaration
public ColorMixture ColorMixture { get; set; }
Property Value
Type | Description |
---|---|
ColorMixture |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The terminal or the current window have been disposed. |
NotSupportedException | The soft key labels are disabled. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |
Enabled
Specifies if the manager is enabled.
Declaration
public bool Enabled { get; }
Property Value
Type | Description |
---|---|
bool |
LabelCount
Gets the number of labels within the soft key label panel.
Declaration
public int LabelCount { get; }
Property Value
Type | Description |
---|---|
int |
Exceptions
Type | Condition |
---|---|
NotSupportedException | The soft key labels are disabled. |
Style
Gets or sets the style of the window.
Declaration
public Style Style { get; set; }
Property Value
Type | Description |
---|---|
Style |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The terminal or the current window have been disposed. |
NotSupportedException | The soft key labels are disabled. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |
Terminal
The terminal this manager belongs to.
Declaration
public Terminal Terminal { get; }
Property Value
Type | Description |
---|---|
Terminal |
Methods
Clear()
Clears the soft key labels from the screen. They can be restored by calling Restore() method.
Declaration
public void Clear()
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The terminal or the current window have been disposed. |
NotSupportedException | The soft key labels are disabled. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |
DisableAttributes(VideoAttribute)
Disables specified attributes and keep the others untouched.
Declaration
public void DisableAttributes(VideoAttribute attributes)
Parameters
Type | Name | Description |
---|---|---|
VideoAttribute | attributes | The attributes to disable. |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The terminal or the current window have been disposed. |
NotSupportedException | The soft key labels are disabled. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |
EnableAttributes(VideoAttribute)
Enables specified attributes and keep the others untouched.
Declaration
public void EnableAttributes(VideoAttribute attributes)
Parameters
Type | Name | Description |
---|---|---|
VideoAttribute | attributes | The attributes to enable. |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The terminal or the current window have been disposed. |
NotSupportedException | The soft key labels are disabled. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |
MarkDirty()
Marks the the soft key labels as dirty, and thus, eligible for refresh.
Declaration
public void MarkDirty()
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The terminal or the current window have been disposed. |
NotSupportedException | The soft key labels are disabled. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |
Refresh()
Refreshes the soft label keys.
Declaration
public void Refresh()
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The terminal or the current window have been disposed. |
NotSupportedException | The soft key labels are disabled. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |
Restore()
Restores the soft key labels to the screen. They can be cleared by calling Clear() method.
Declaration
public void Restore()
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The terminal or the current window have been disposed. |
NotSupportedException | The soft key labels are disabled. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |
SetLabel(int, string, SoftLabelKeyAlignment)
Sets a given label within the soft key label panel.
Declaration
public void SetLabel(int index, string title, SoftLabelKeyAlignment align)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the label. |
string | title | The title of the label. |
SoftLabelKeyAlignment | align | Alignment of the label title. |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
ArgumentOutOfRangeException | The |
ObjectDisposedException | The terminal has been disposed. |
NotSupportedException | The soft key labels are disabled. |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
CursesOperationException | A Curses error occured. |