Show / Hide Table of Contents

Class ListDictionary<TKey, TValue>

A dictionary of lists.

Inheritance
System.Object
ListDictionary<TKey, TValue>
Implements
System.Collections.Generic.IDictionary<TKey, System.Collections.Generic.IList<TValue>>
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, System.Collections.Generic.IList<TValue>>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, System.Collections.Generic.IList<TValue>>>
System.Collections.IEnumerable
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Infrastructure
Assembly: Sartorius.SAF.dll
Syntax
public sealed class ListDictionary<TKey, TValue> : IDictionary<TKey, IList<TValue>>, ICollection<KeyValuePair<TKey, IList<TValue>>>, IEnumerable<KeyValuePair<TKey, IList<TValue>>>, IEnumerable
Type Parameters
Name Description
TKey

The key to use for lists.

TValue

The type of the value held by lists.

Properties

View Source

Count

Gets the number of lists in the dictionary.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

Value indicating the values count.

View Source

Item[TKey]

Gets or sets the list associated with the given key. The access always succeeds, eventually returning an empty list.

Declaration
public IList<TValue> this[TKey key] { get; set; }
Parameters
Type Name Description
TKey key

The key of the list to access.

Property Value
Type Description
System.Collections.Generic.IList<TValue>

The list associated with the key.

View Source

Keys

Gets the list of keys in the dictionary.

Declaration
public ICollection<TKey> Keys { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<TKey>

Collection of keys.

View Source

Values

Gets a shallow copy of all values in all lists.

Declaration
public IList<TValue> Values { get; }
Property Value
Type Description
System.Collections.Generic.IList<TValue>

List of values.

Methods

View Source

Add(TKey)

If a list does not already exist, it will be created automatically.

Declaration
public void Add(TKey key)
Parameters
Type Name Description
TKey key

The key of the list that will hold the value.

View Source

Add(TKey, TValue)

Adds a value to a list with the given key. If a list does not already exist, it will be created automatically.

Declaration
public void Add(TKey key, TValue value)
Parameters
Type Name Description
TKey key

The key of the list that will hold the value.

TValue value

The value to add to the list under the given key.

View Source

Clear()

Removes all entries in the dictionary.

Declaration
public void Clear()
View Source

ContainsKey(TKey)

Determines whether the dictionary contains the given key.

Declaration
public bool ContainsKey(TKey key)
Parameters
Type Name Description
TKey key

The key to locate.

Returns
Type Description
System.Boolean

true if the dictionary contains the given key; otherwise, false.

View Source

ContainsValue(TValue)

Determines whether the dictionary contains the specified value.

Declaration
public bool ContainsValue(TValue value)
Parameters
Type Name Description
TValue value

The value to locate.

Returns
Type Description
System.Boolean

true if the dictionary contains the value in any list; otherwise, false.

View Source

FindAllValues(Predicate<TValue>)

Retrieves all the elements that match the condition defined by the specified predicate.

Declaration
public IEnumerable<TValue> FindAllValues(Predicate<TValue> valueFilter)
Parameters
Type Name Description
System.Predicate<TValue> valueFilter

The filter with the condition to use to filter values.

Returns
Type Description
System.Collections.Generic.IEnumerable<TValue>

The elements that match the condition defined by the specified predicate.

View Source

FindAllValuesByKey(Predicate<TKey>)

Retrieves the all the elements from the list which have a key that matches the condition defined by the specified predicate.

Declaration
public IEnumerable<TValue> FindAllValuesByKey(Predicate<TKey> keyFilter)
Parameters
Type Name Description
System.Predicate<TKey> keyFilter

The filter with the condition to use to filter lists by their key.

Returns
Type Description
System.Collections.Generic.IEnumerable<TValue>

The elements that have a key that matches the condition defined by the specified predicate.

View Source

Remove(TKey)

Removes a list by key.

Declaration
public bool Remove(TKey key)
Parameters
Type Name Description
TKey key

The key of the list to remove.

Returns
Type Description
System.Boolean

true if the element was removed.

View Source

Remove(TKey, TValue)

Removes a value from the list with the given key.

Declaration
public void Remove(TKey key, TValue value)
Parameters
Type Name Description
TKey key

The key of the list where the value exists.

TValue value

The value to remove.

View Source

Remove(TValue)

Removes a value from all lists where it may be found.

Declaration
public void Remove(TValue value)
Parameters
Type Name Description
TValue value

The value to remove.

Explicit Interface Implementations

View Source

ICollection<KeyValuePair<TKey, IList<TValue>>>.Add(KeyValuePair<TKey, IList<TValue>>)

See System.Collections.Generic.ICollection<T>.Add(T) for more information.

Declaration
void ICollection<KeyValuePair<TKey, IList<TValue>>>.Add(KeyValuePair<TKey, IList<TValue>> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<TKey, System.Collections.Generic.IList<TValue>> item
View Source

ICollection<KeyValuePair<TKey, IList<TValue>>>.Contains(KeyValuePair<TKey, IList<TValue>>)

See System.Collections.Generic.ICollection<T>.Contains(T) for more information.

Declaration
bool ICollection<KeyValuePair<TKey, IList<TValue>>>.Contains(KeyValuePair<TKey, IList<TValue>> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<TKey, System.Collections.Generic.IList<TValue>> item
Returns
Type Description
System.Boolean
View Source

ICollection<KeyValuePair<TKey, IList<TValue>>>.CopyTo(KeyValuePair<TKey, IList<TValue>>[], Int32)

See System.Collections.Generic.ICollection<T>.CopyTo(T[], System.Int32) for more information.

Declaration
void ICollection<KeyValuePair<TKey, IList<TValue>>>.CopyTo(KeyValuePair<TKey, IList<TValue>>[] array, int arrayIndex)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<TKey, System.Collections.Generic.IList<TValue>>[] array
System.Int32 arrayIndex
View Source

ICollection<KeyValuePair<TKey, IList<TValue>>>.IsReadOnly

See System.Collections.Generic.ICollection<T>.IsReadOnly for more information.

Declaration
bool ICollection<KeyValuePair<TKey, IList<TValue>>>.IsReadOnly { get; }
Returns
Type Description
System.Boolean
View Source

ICollection<KeyValuePair<TKey, IList<TValue>>>.Remove(KeyValuePair<TKey, IList<TValue>>)

See System.Collections.Generic.ICollection<T>.Remove(T) for more information.

Declaration
bool ICollection<KeyValuePair<TKey, IList<TValue>>>.Remove(KeyValuePair<TKey, IList<TValue>> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<TKey, System.Collections.Generic.IList<TValue>> item
Returns
Type Description
System.Boolean
View Source

IDictionary<TKey, IList<TValue>>.Add(TKey, IList<TValue>)

Declaration
void IDictionary<TKey, IList<TValue>>.Add(TKey key, IList<TValue> value)
Parameters
Type Name Description
TKey key
System.Collections.Generic.IList<TValue> value
View Source

IDictionary<TKey, IList<TValue>>.TryGetValue(TKey, out IList<TValue>)

See System.Collections.Generic.IDictionary<TKey, TValue>.TryGetValue(TKey, TValue) for more information.

Declaration
bool IDictionary<TKey, IList<TValue>>.TryGetValue(TKey key, out IList<TValue> value)
Parameters
Type Name Description
TKey key
System.Collections.Generic.IList<TValue> value
Returns
Type Description
System.Boolean
View Source

IDictionary<TKey, IList<TValue>>.Values

See System.Collections.Generic.IDictionary<TKey, TValue>.Values for more information.

Declaration
ICollection<IList<TValue>> IDictionary<TKey, IList<TValue>>.Values { get; }
Returns
Type Description
System.Collections.Generic.ICollection<System.Collections.Generic.IList<TValue>>
View Source

IEnumerable<KeyValuePair<TKey, IList<TValue>>>.GetEnumerator()

See System.Collections.Generic.IEnumerable<T>.GetEnumerator() for more information.

Declaration
IEnumerator<KeyValuePair<TKey, IList<TValue>>> IEnumerable<KeyValuePair<TKey, IList<TValue>>>.GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, System.Collections.Generic.IList<TValue>>>
View Source

IEnumerable.GetEnumerator()

See System.Collections.IEnumerable.GetEnumerator() for more information.

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

Implements

System.Collections.Generic.IDictionary<TKey, TValue>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX