Table of Contents

Class DictionaryList<K, T>

Namespace
Tlabs.Misc
Assembly
Tlabs.Core.dll

Dictionary of IEnumerable<T> of key type K.

public class DictionaryList<K, T> : IDictionaryList<K, T>, IReadOnlyDictList<K, T>, IEnumerable<KeyValuePair<K, IEnumerable<T>>>, IEnumerable where K : notnull

Type Parameters

K
T
Inheritance
DictionaryList<K, T>
Implements
Inherited Members
Extension Methods

Constructors

DictionaryList()

Default ctor.

public DictionaryList()

DictionaryList(Func<K, IEnumerable<T>>, IEqualityComparer<K>?)

Default ctor.

public DictionaryList(Func<K, IEnumerable<T>> defaultValue, IEqualityComparer<K>? comp = null)

Parameters

defaultValue Func<K, IEnumerable<T>>
comp IEqualityComparer<K>

Properties

Count

Count of all values (of all enumerations).

public int Count { get; }

Property Value

int

IsReadOnly

public bool IsReadOnly { get; }

Property Value

bool

this[K]

The list (enumation) associated with key.

public IEnumerable<T> this[K key] { get; set; }

Parameters

key K

Property Value

IEnumerable<T>

Keys

Read-only collection of keys.

public IEnumerable<K> Keys { get; }

Property Value

IEnumerable<K>

Values

Read-only collection of all values (of all enumerations).

public IEnumerable<T> Values { get; }

Property Value

IEnumerable<T>

Methods

Add(KeyValuePair<K, IEnumerable<T>>)

Add pair.

public void Add(KeyValuePair<K, IEnumerable<T>> pair)

Parameters

pair KeyValuePair<K, IEnumerable<T>>

Add(K, T)

Add value to enumerable assocoated with key.

public void Add(K key, T value)

Parameters

key K
value T

AddRange(K, IEnumerable<T>)

Add all values to enumerable assocoated with key.

public void AddRange(K key, IEnumerable<T> values)

Parameters

key K
values IEnumerable<T>

Clear()

Clear.

public void Clear()

Contains(T)

Checks whether item is contained in any enumerable.

public bool Contains(T item)

Parameters

item T

Returns

bool

ContainsKey(K)

Checks whether key is assocoated with an enumerable.

public bool ContainsKey(K key)

Parameters

key K

Returns

bool

GetEnumerator()

public IEnumerator<KeyValuePair<K, IEnumerable<T>>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<K, IEnumerable<T>>>

Remove(K)

Returns true if enumerable assocoated with key was removed.

public bool Remove(K key)

Parameters

key K

Returns

bool

Remove(K, T)

Returns true if value was rmoved from enumerable assocoated with key.

public bool Remove(K key, T value)

Parameters

key K
value T

Returns

bool

TryGetValue(K, out IEnumerable<T>)

Try get value by key.

public bool TryGetValue(K key, out IEnumerable<T> value)

Parameters

key K
value IEnumerable<T>

Returns

bool

Explicit Interface Implementations

IEnumerable.GetEnumerator()

IEnumerator IEnumerable.GetEnumerator()

Returns

IEnumerator

IReadOnlyDictList<K, T>.IsReadOnly

bool IReadOnlyDictList<K, T>.IsReadOnly { get; }

Returns

bool