Table of Contents

Class IndexedValues<TIndex, TValue>

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Allows to get and set indexed values as fast as possible.

public class IndexedValues<TIndex, TValue> : BaseObject, IBaseObject where TIndex : notnull

Type Parameters

TIndex
TValue
Inheritance
IndexedValues<TIndex, TValue>
Implements

Properties

this[TIndex]

Gets or sets value for the specified index.

Values

Gets a collection that contains the values.

Methods

Clear()

Removes all keys and values from the dictionary. All previously locked items become invalid.

GetLockedItem(TIndex)

Gets locked item which allows to access index and value as fast as possible.

GetLockedItem(TIndex, Func<TValue?>)

Gets locked item initialized with the default value.

GetLockedItemCached(TIndex, Func<TValue?>)

Same as GetLockedItemCached(TIndex, Func<TValue?>) but caches last accessed index value, so repeated calls with the same index will work faster.

GetValue(TIndex)

Gets value for the specified index.

GetValue(TIndex, Func<TValue>)

Gets value for the specified index. If value was not assigned, getDefault function is used to initialize index/value pair.

SetValue(TIndex, TValue?)

Sets value for the specified index.

Events

AfterClear

Occurs after all items are cleared.