Show / Hide Table of Contents

Class ItemSelector<T>

A generic class that keeps track of our current (and previous) generic item selection in a collection. (e.g. radio button, selecting one element out of a list).

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
ThemeElement
ItemSelector<T>
SidebarPages
Implements
IColorHook
Inherited Members
ThemeElement.Timer
ThemeElement.Initialize(PomodoroTimer, Boolean)
ThemeElement.IsInitialized()
ThemeElement.ColorUpdate(Theme)
ThemeElement.OnDestroy()
Namespace: AdrianMiasik.Components.Base
Assembly: Assembly-CSharp.dll
Syntax
public class ItemSelector<T> : ThemeElement, IColorHook
Type Parameters
Name Description
T

Fields

| Improve this Doc View Source

m_items

Declaration
[SerializeField]
protected Collection<T> m_items
Field Value
Type Description
System.Collections.ObjectModel.Collection<T>
| Improve this Doc View Source

onDeselected

Declaration
public ItemSelector<T>.OnDeselected onDeselected
Field Value
Type Description
ItemSelector.OnDeselected<>
| Improve this Doc View Source

onSelected

Declaration
public ItemSelector<T>.OnSelected onSelected
Field Value
Type Description
ItemSelector.OnSelected<>
| Improve this Doc View Source

onSelectionChange

Declaration
public ItemSelector<T>.OnSelectionChange onSelectionChange
Field Value
Type Description
ItemSelector.OnSelectionChange<>

Methods

| Improve this Doc View Source

AddItem(T)

Declaration
public void AddItem(T item)
Parameters
Type Name Description
T item
| Improve this Doc View Source

Clear()

Declaration
public void Clear()
| Improve this Doc View Source

GetCount()

Declaration
public int GetCount()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetCurrentIndex()

Declaration
public int GetCurrentIndex()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetCurrentItem()

Returns the current visible item

Declaration
public T GetCurrentItem()
Returns
Type Description
T
| Improve this Doc View Source

GetItems()

Declaration
public Collection<T> GetItems()
Returns
Type Description
System.Collections.ObjectModel.Collection<T>
| Improve this Doc View Source

GetLastSelectedItem()

Declaration
public T GetLastSelectedItem()
Returns
Type Description
T
| Improve this Doc View Source

Initialize(IEnumerable<T>)

Initializes with a specific set of objects

Declaration
protected virtual void Initialize(IEnumerable<T> allSelectionItems)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T> allSelectionItems
| Improve this Doc View Source

NextItem()

Selects the next item in the collection

Declaration
public void NextItem()
| Improve this Doc View Source

PreviousItem()

Selects the previous item in the collection

Declaration
public void PreviousItem()
| Improve this Doc View Source

RemoveItem(T)

Declaration
public void RemoveItem(T item)
Parameters
Type Name Description
T item
| Improve this Doc View Source

Select(T)

If your item is within our list, we will set the current item to it.

Declaration
public bool Select(T itemInList)
Parameters
Type Name Description
T itemInList
Returns
Type Description
System.Boolean

Implements

IColorHook
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX