|
PeanutButter
|
Provides a mechanism to merge multiple dictionaries into one Source dictionaries. More...
Public Member Functions | |
| MergeDictionary (params IDictionary< TKey, TValue >[] layers) | |
| Construct MergeDictionary over other dictionaries. | |
| IEnumerator< KeyValuePair< TKey, TValue > > | GetEnumerator () |
| Gets an Enumerator for the KeyValuePairs in this merged dictionary, prioritised by the order of provided layers. | |
| void | Add (KeyValuePair< TKey, TValue > item) |
| Will throw - MergeDictionary is read-only. | |
| void | Clear () |
| Will throw - MergeDictionary is read-only. | |
| bool | Contains (KeyValuePair< TKey, TValue > item) |
| Returns true if any layer contains the provided item. | |
| void | CopyTo (KeyValuePair< TKey, TValue >[] array, int arrayIndex) |
| Copies the prioritised items to the provided array from the given arrayIndex. | |
| bool | Remove (KeyValuePair< TKey, TValue > item) |
| Will throw an exception - MergeDictionary is read-only. | |
| bool | ContainsKey (TKey key) |
| Searches for the given key across all layers. | |
| void | Add (TKey key, TValue value) |
| Will throw - MergeDictionaries are read-only. | |
| bool | Remove (TKey key) |
| Will throw - MergeDictionaries are read-only. | |
| bool | TryGetValue (TKey key, out TValue value) |
| Tries to get a value by key from the underlying layers. | |
| void | AppendLayer (IDictionary< TKey, TValue > layer) |
| Append a layer to the collection. | |
| void | InsertLayer (IDictionary< TKey, TValue > layer) |
| Insert a layer at the top of the stack. | |
| void | InsertLayer (int idx, IDictionary< TKey, TValue > layer) |
| Insert a layer at the provided index - see LayerCount for the valid range. | |
Properties | |
| IEqualityComparer< TKey > | Comparer [get] |
| Expose the first (or least-restrictive, for strings) key comparer. | |
| int | Count [get] |
| Returns the count of distinct keys. | |
| bool | IsReadOnly [get] |
| Will return true: MergeDictionaries are read-only. | |
| TValue | this[TKey key] [get, set] |
| Index into the layers to find the highest-priority match for the provided key. | |
| ICollection< TKey > | Keys [get] |
| Returns a collection of the distinct keys in all layers. | |
| ICollection< TValue > | Values [get] |
| Returns a collection of ALL values in all layers. | |
| int | LayerCount [get] |
| Reflects the number of layers in this merged dictionary. | |
Provides a mechanism to merge multiple dictionaries into one Source dictionaries.
| TKey | |
| TValue |
| PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.MergeDictionary | ( | params IDictionary< TKey, TValue >[] | layers | ) |
Construct MergeDictionary over other dictionaries.
| layers |
| void PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.Add | ( | KeyValuePair< TKey, TValue > | item | ) |
Will throw - MergeDictionary is read-only.
| item |
| InvalidOperationException |
Will throw - MergeDictionaries are read-only.
| key | |
| value |
| InvalidOperationException |
| void PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.AppendLayer | ( | IDictionary< TKey, TValue > | layer | ) |
Append a layer to the collection.
| layer |
| void PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.Clear | ( | ) |
Will throw - MergeDictionary is read-only.
| InvalidOperationException |
| bool PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.Contains | ( | KeyValuePair< TKey, TValue > | item | ) |
Returns true if any layer contains the provided item.
| item | Item to search for |
| bool PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.ContainsKey | ( | TKey | key | ) |
Searches for the given key across all layers.
| key | Key to search for |
| void PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.CopyTo | ( | KeyValuePair< TKey, TValue >[] | array, |
| int | arrayIndex | ||
| ) |
Copies the prioritised items to the provided array from the given arrayIndex.
| array | Target array to copy to |
| arrayIndex | Index to start copying at |
| IEnumerator< KeyValuePair< TKey, TValue > > PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.GetEnumerator | ( | ) |
Gets an Enumerator for the KeyValuePairs in this merged dictionary, prioritised by the order of provided layers.
| void PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.InsertLayer | ( | IDictionary< TKey, TValue > | layer | ) |
Insert a layer at the top of the stack.
| layer |
| void PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.InsertLayer | ( | int | idx, |
| IDictionary< TKey, TValue > | layer | ||
| ) |
Insert a layer at the provided index - see LayerCount for the valid range.
| idx | |
| layer |
| bool PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.Remove | ( | KeyValuePair< TKey, TValue > | item | ) |
Will throw an exception - MergeDictionary is read-only.
| item | Item to remove |
| InvalidOperationException |
| bool PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.Remove | ( | TKey | key | ) |
Will throw - MergeDictionaries are read-only.
| key |
| InvalidOperationException |
| bool PeanutButter.Utils.Dictionaries.MergeDictionary< TKey, TValue >.TryGetValue | ( | TKey | key, |
| out TValue | value | ||
| ) |
Tries to get a value by key from the underlying layers.
| key | Key to search for |
| value | Value to search for |
Index into the layers to find the highest-priority match for the provided key.
| key | Key to look up |