Table of Contents

Class FlagsAndAttributes<TKey, TValue>

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

Default implementation of the flags and attributes used in the library.

public class FlagsAndAttributes<TKey, TValue> : AdvDictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable, IFlagsAndAttributes<TKey, TValue>, ICustomFlags<TKey>, IReadOnlyFlags<TKey>, ICustomAttributes<TKey, TValue>, IReadOnlyAttributes<TKey, TValue> where TKey : notnull

Type Parameters

TKey

The type of the identifiers.

TValue

The type of the values.

Inheritance
Dictionary<TKey, TValue>
AdvDictionary<TKey, TValue>
FlagsAndAttributes<TKey, TValue>
Implements
IDictionary<TKey, TValue>
ICollection<KeyValuePair<TKey, TValue>>
IReadOnlyDictionary<TKey, TValue>
IEnumerable<KeyValuePair<TKey, TValue>>
IFlagsAndAttributes<TKey, TValue>
ICustomAttributes<TKey, TValue>
IReadOnlyAttributes<TKey, TValue>

Properties

Attr

Gets custom attributes provider.

Flags

Gets custom flags provider.

Methods

AddFlag(TKey)

Adds flag with id.

GetAttribute(TKey)

Gets attribute value. Returns null if there is no such attribute.

GetAttribute<T2>(TKey)

Gets attribute value as TKey type.

GetAttribute<T2>(TKey, T2)

Gets attribute value as T2 type or defaultValue if there is no such attribute.

HasAttribute(TKey)

Attribute with id was added.

HasFlag(TKey)

Flag with id was added.

RemoveAttribute(TKey)

Removes attribute with id.

RemoveFlag(TKey)

Removes flag with id.

SetAttribute(TKey, TValue?)

Sets attribute value.

SetAttribute<T2>(TKey, T2?)

Sets attribute value.

SetFlag(TKey, bool)

Adds flag if value is true, removes flag if its false.

ToggleFlag(TKey)

If flag with id was previously added, it is removed. And if there is no such flag, it is added.