Table of Contents

Class ListItem

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

Represents an item in a ListControl.

public class ListItem
Inheritance
ListItem
Inherited Members

Constructors

ListItem(string, string?, Color?)

Initializes a new ListItem with text, optional icon, and icon color.

public ListItem(string text, string? icon = null, Color? iconColor = null)

Parameters

text string

The text content of the item.

icon string

Optional icon to display before the text.

iconColor Color?

Optional color for the icon.

Properties

Icon

Gets or sets the icon displayed before the item text.

public string? Icon { get; set; }

Property Value

string

IconColor

Gets or sets the color of the icon.

public Color? IconColor { get; set; }

Property Value

Color?

IsEnabled

Gets or sets whether this item is enabled.

public bool IsEnabled { get; set; }

Property Value

bool

Lines

Gets the text split into separate lines for multi-line items.

public List<string> Lines { get; }

Property Value

List<string>

Tag

Gets or sets a custom object associated with this item.

public object? Tag { get; set; }

Property Value

object

Text

Gets or sets the text content of the item.

public string Text { get; set; }

Property Value

string

Operators

implicit operator ListItem(string)

Implicitly converts a string to a ListItem for convenience.

public static implicit operator ListItem(string text)

Parameters

text string

The text to convert.

Returns

ListItem