Class Selector<T>
Definition
- Namespace:
- Tizen.NUI.BaseComponents
- Assembly:
- Tizen.NUI.dll
The selector class is a collection of a ControlState and a T value pair.
public class Selector<T> : IEnumerable<SelectorItem<T>>
- Inheritance
-
objectSelector<T>
- Derived
Constructors
View SourceSelector()
Create an empty selector.
Declaration
public Selector()
Selector(T)
Declaration
public Selector(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value |
Selector(Selector<T>)
Declaration
public Selector(Selector<T> value)
Parameters
Type | Name | Description |
---|---|---|
Selector<T> | value |
Properties
View SourceAll
All State.
Declaration
public T All { get; set; }
Property Value
Type | Description |
---|---|
T |
Count
Gets the number of elements.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
Disabled
Disabled State.
Declaration
public T Disabled { get; set; }
Property Value
Type | Description |
---|---|
T |
DisabledFocused
DisabledFocused State.
Declaration
public T DisabledFocused { get; set; }
Property Value
Type | Description |
---|---|
T |
DisabledSelected
DisabledSelected State.
Declaration
public T DisabledSelected { get; set; }
Property Value
Type | Description |
---|---|
T |
Focused
Focused State.
Declaration
public T Focused { get; set; }
Property Value
Type | Description |
---|---|
T |
IsReadOnly
Gets a value indicating whether the selector is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
Normal
Normal State.
Declaration
public T Normal { get; set; }
Property Value
Type | Description |
---|---|
T |
Other
Other State.
Declaration
public T Other { get; set; }
Property Value
Type | Description |
---|---|
T |
Pressed
Pressed State.
Declaration
public T Pressed { get; set; }
Property Value
Type | Description |
---|---|
T |
Selected
Selected State.
Declaration
public T Selected { get; set; }
Property Value
Type | Description |
---|---|
T |
SelectedFocused
SelectedFocused State.
Declaration
public T SelectedFocused { get; set; }
Property Value
Type | Description |
---|---|
T |
SelectedPressed
SelectedPressed State.
Declaration
public T SelectedPressed { get; set; }
Property Value
Type | Description |
---|---|
T |
Methods
View SourceAdd(ControlState, T)
Adds the specified state and value to the selector.
Declaration
public void Add(ControlState state, T value)
Parameters
Type | Name | Description |
---|---|---|
ControlState | state | The state. |
T | value | The value associated with state. |
Add(SelectorItem<T>)
Adds the specified state and value to the selector.
Declaration
public void Add(SelectorItem<T> item)
Parameters
Type | Name | Description |
---|---|---|
SelectorItem<T> | item | The selector item includes state and value. |
Clear()
Removes all elements.
Declaration
public void Clear()
Clone()
Clone itself. If type T implements ICloneable, it calls Clone() method to clone values, otherwise use operator=.
Declaration
public Selector<T> Clone()
Returns
Type | Description |
---|---|
Selector<T> |
Clone(Selector<T>)
Copy values from other selector.
Declaration
public void Clone(Selector<T> other)
Parameters
Type | Name | Description |
---|---|---|
Selector<T> | other |
Clone<TOut>(Converter<T, TOut>)
Clone with type converter.
Declaration
public Selector<TOut> Clone<TOut>(Converter<T, TOut> converter)
Parameters
Type | Name | Description |
---|---|---|
Converter<, ><T, TOut> | converter |
Returns
Type | Description |
---|---|
Selector<TOut> |
Type Parameters
Name | Description |
---|---|
TOut |
Contains(SelectorItem<T>)
Determines whether the selector contains a specific value.
Declaration
public bool Contains(SelectorItem<T> item)
Parameters
Type | Name | Description |
---|---|---|
SelectorItem<T> | item | The selector item includes state and value. |
Returns
Type | Description |
---|---|
bool | True if item is found in the selector. otherwise, false. |
CopyTo(SelectorItem<T>[], int)
Copies the elements of the selector to an Array, starting at a particular Array index.
Declaration
public void CopyTo(SelectorItem<T>[] items, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
SelectorItem<T>[] | items | The one-dimensional array that is the destination of the elements copied from selector. The Array must have zero-based indexing. |
int | startIndex | The zero-based index in array at which copying begins. |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
object | other |
Returns
Type | Description |
---|---|
bool |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<SelectorItem<T>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<><SelectorItem<T>> |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
GetValue(ControlState, out T)
Get value by State. It will traverse from the first item to find proper fit when there is no perfect state match.
Declaration
public bool GetValue(ControlState state, out T result)
Parameters
Type | Name | Description |
---|---|---|
ControlState | state | |
T | result |
Returns
Type | Description |
---|---|
bool | True if the selector has a given state value, false otherwise. |
Remove(SelectorItem<T>)
Remove an item from the selector.
Declaration
public bool Remove(SelectorItem<T> item)
Parameters
Type | Name | Description |
---|---|---|
SelectorItem<T> | item | The selector item includes state and value. |
Returns
Type | Description |
---|---|
bool |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Operators
View Sourceimplicit operator Selector<T>(T)
Implicitly convert T type value to selector.
Declaration
public static implicit operator Selector<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value will be converted to a selector. |
Returns
Type | Description |
---|---|
Selector<T> |