PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.Dictionaries.RedirectingDictionary< TValue > Class Template Reference

Provides a wrapping read-write layer around another dictionary effectively allowing transparent rename of the keys. More...

Inheritance diagram for PeanutButter.Utils.Dictionaries.RedirectingDictionary< TValue >:

Public Member Functions

 RedirectingDictionary (IDictionary< string, TValue > data, TransformFunc toNativeTransform, TransformFunc fromNativeTransform)
 Constructs a new RedirectingDictionary.
IEnumerator< KeyValuePair< string, TValue > > GetEnumerator ()
void Add (KeyValuePair< string, TValue > item)
void Clear ()
bool Contains (KeyValuePair< string, TValue > item)
void CopyTo (KeyValuePair< string, TValue >[] array, int arrayIndex)
bool Remove (KeyValuePair< string, TValue > item)
bool ContainsKey (string key)
void Add (string key, TValue value)
bool Remove (string key)
bool TryGetValue (string key, out TValue value)

Properties

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

Detailed Description

Provides a wrapping read-write layer around another dictionary effectively allowing transparent rename of the keys.

Template Parameters
TValueType of values stored

Member Function Documentation

◆ RedirectingDictionary()

PeanutButter.Utils.Dictionaries.RedirectingDictionary< TValue >.RedirectingDictionary ( IDictionary< string, TValue > data,
TransformFunc toNativeTransform,
TransformFunc fromNativeTransform )

Constructs a new RedirectingDictionary.

Parameters
dataData to wrap
toNativeTransformFunction to transform keys from those used against this object to native ones in the data parameter
fromNativeTransformFunction to transform keys from those in the data object (native) to those presented by this object
Exceptions
ArgumentNullExceptionThrown if null data or key transform are supplied

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