Summary
Encapsulates a collection that maps keys to collections of values.
Provides the ability to cheaply make the collection fully read-only.
Provides a sort of auto-vivification for convenience.
Generic type parameters
TValue | The type of the values to be associated with each key. |
Example
// initially myNameValue does not contain the key "fruits"
int c = myNameValues["fruits"].Count; // c == 0
myNameValues["fruits"].Add("orange");
// myNameValue now contains the key "fruits", with one value associated.
Constructors
|
Creates an empty collection.
|
|
Instance methods
void | |
Adds the specified key and value collection.
|
void | |
Adds all items from the specified value collection, associating them with
the specified key. Throws an exception if the specified key already has items
associated with it.
|
NameValuesCollection<TValue> | |
Returns a read-only version of this collection. The returned collection could be the
same as this one, if it's already read-only, or it could be a wrapper created around
the items in this collection. If the original collection gets modified, the read-only
version will reflect the changes instantly.
|
void | |
Clears all items from this collection.
|
bool | |
Not implemented.
|
bool | |
Returns true iff this collection has at least one value associated with the specified key.
|
void | CopyTo(KeyValuePair<string, ValuesCollection<TValue>>[] array, int arrayIndex) |
Copies all key/value-collection pairs to the specified array.
|
IEnumerator<KeyValuePair<string, ValuesCollection<TValue>>> | |
Gets an enumerator to iterate over all key/value-collection pairs in this collection.
|
bool | |
Removes all items associated with the specified key. Returns true iff any items were removed.
|
bool | |
Not implemented.
|
bool | |
Gets the collection of values associated with the specified key, or an empty collection
if no such items exist. Returns true iff any items are associated with the key.
|
Instance properties
int | |
Gets the number of keys in this collection which have at least one value associated with them.
|
bool | |
Returns true iff this collection is read-only (cannot be modified).
|
ValuesCollection<TValue> | |
Gets or sets a collection of values associated with the specified key.
|
ICollection<string> | |
Gets a collection of the keys that have at least one value associated with them. This
method is not particularly cheap.
|
ICollection<ValuesCollection<TValue>> | |
Gets the collection of all value collections. This method is not particularly cheap.
|