PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.Dictionaries.TransformingDictionary< TKey, TValue > Class Template Reference

Provides access to an underlying dictionary with the keys held intact and the values passed through a transform. More...

Inheritance diagram for PeanutButter.Utils.Dictionaries.TransformingDictionary< TKey, TValue >:

Public Member Functions

 TransformingDictionary (Func< KeyValuePair< TKey, TValue >, TValue > mutator)
 Construct the transforming dictionary without an external data store - this may be useful for, eg, sanitising data.
 TransformingDictionary (Func< KeyValuePair< TKey, TValue >, TValue > mutator, IDictionary< TKey, TValue > underlyingData)
 Construct the TransformingDictionary with the underlying data.
IEnumerator< KeyValuePair< TKey, TValue > > GetEnumerator ()
void Add (KeyValuePair< TKey, TValue > item)
void Clear ()
bool Contains (KeyValuePair< TKey, TValue > item)
void CopyTo (KeyValuePair< TKey, TValue >[] array, int arrayIndex)
bool Remove (KeyValuePair< TKey, TValue > item)
void Add (TKey key, TValue value)
bool ContainsKey (TKey key)
bool Remove (TKey key)
bool TryGetValue (TKey key, out TValue value)

Properties

int Count [get]
bool IsReadOnly [get]
TValue this[TKey key] [get, set]
ICollection< TKey > Keys [get]
ICollection< TValue > Values [get]

Detailed Description

Provides access to an underlying dictionary with the keys held intact and the values passed through a transform.

Template Parameters
TKey
TValue

Member Function Documentation

◆ TransformingDictionary() [1/2]

PeanutButter.Utils.Dictionaries.TransformingDictionary< TKey, TValue >.TransformingDictionary ( Func< KeyValuePair< TKey, TValue >, TValue > mutator)

Construct the transforming dictionary without an external data store - this may be useful for, eg, sanitising data.

Parameters
mutator

◆ TransformingDictionary() [2/2]

PeanutButter.Utils.Dictionaries.TransformingDictionary< TKey, TValue >.TransformingDictionary ( Func< KeyValuePair< TKey, TValue >, TValue > mutator,
IDictionary< TKey, TValue > underlyingData )

Construct the TransformingDictionary with the underlying data.

Parameters
mutator
underlyingData

The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.Utils/Dictionaries/TransformingDictionary.cs