DataItem

Description

sealed class Tinman.Engine.GUI.Components.DataItem

A simple data item for displaying lists and trees with a DataGrid.

Public / Constructors

Data​Item


public constructor DataItem → (3)

text opt : string = null

Initial value for Text.

image opt : IResourceHandle = null

Initial value for Image.

userData opt : object = null

Initial value for UserData.

Creates a new instance of DataItem.

Public / Methods

Item​For

2 overloads


[Pure]
public method ItemFor1 → (1)

userData in : object

The user data object to find.

returns → DataItem

The found data item or null if none.

Finds the first data item that has the given user data object.


[Pure]
public method ItemFor2 → (1)

path in : DataGridPath

The path or null if none.

returns → DataItem

The found data item or null if none.

Finds the data item that is referenced by this given path.

Path​For


public method PathFor → (1)

grid in : DataGrid

[not-null]
The data grid.

returns → DataGridPath

The data grid path or null if not found.

Returns the path to this data item in the given data grid.

Public / Attributes

Children


public attribute Children → (get)

value : IVector<DataItem>

[not-null]
The list of child items.

Returns the list of child items.

Has​Children


public attribute HasChildren → (get)

value : bool

true if this item has at least one child, false if it has none.

Does this item has children?

Image


public attribute Image → (get,set)

value : IResourceHandle

The image or null.

The image of this item.

Text


public attribute Text → (get,set)

value : string

The text of null

The text of this item.

User​Data


public attribute UserData → (get,set)

value : object

The user data object or null.

Optional user data object to associate with this item.