NanoByte.Common  2.6.1
NanoByte.Common.Collections.XmlDictionary Class Reference

A string dictionary that supports data-binding and can be XML serialized. More...

Inheritance diagram for NanoByte.Common.Collections.XmlDictionary:
NanoByte.Common.ICloneable< XmlDictionary >

Public Member Functions

void Add (string key, string value)
 Adds a new value and links it to a key More...
 
bool Remove (string key)
 Removes all values assigned to this key. More...
 
bool ContainsKey (string key)
 Checks whether this collection contains a certain key. More...
 
bool ContainsValue (string value)
 Checks whether this collection contains a certain value. More...
 
void Sort ()
 Sorts all entries alphabetically by their key. More...
 
string GetValue (string key)
 Returns the value associated to a specific key. More...
 
IDictionary< string, string > ToDictionary ()
 Convert this XmlDictionary to a Dictionary<TKey,TValue> for better lookup-performance. More...
 
virtual XmlDictionary Clone ()
 Creates a deep copy of this XmlDictionary (elements are cloned). More...
 
- Public Member Functions inherited from NanoByte.Common.ICloneable< XmlDictionary >
Clone ()
 Creates a new clone of this instance. More...
 

Protected Member Functions

override void InsertItem (int index, XmlDictionaryEntry item)
 

Detailed Description

A string dictionary that supports data-binding and can be XML serialized.

Member Function Documentation

◆ Add()

void NanoByte.Common.Collections.XmlDictionary.Add ( string  key,
string  value 
)
inline

Adds a new value and links it to a key

Parameters
keyThe key object
valueThe value
Exceptions
ArgumentExceptionThe key already exists in the dictionary.

◆ Clone()

virtual XmlDictionary NanoByte.Common.Collections.XmlDictionary.Clone ( )
inlinevirtual

Creates a deep copy of this XmlDictionary (elements are cloned).

Returns
The cloned XmlDictionary.

◆ ContainsKey()

bool NanoByte.Common.Collections.XmlDictionary.ContainsKey ( string  key)

Checks whether this collection contains a certain key.

Parameters
keyThe key to look for.
Returns
true if the key was found.

◆ ContainsValue()

bool NanoByte.Common.Collections.XmlDictionary.ContainsValue ( string  value)

Checks whether this collection contains a certain value.

Parameters
valueThe value to look for.
Returns
true if the value was found.

◆ GetValue()

string NanoByte.Common.Collections.XmlDictionary.GetValue ( string  key)
inline

Returns the value associated to a specific key.

Parameters
keyThe key to look for.
Returns
The value associated to key .
Exceptions
KeyNotFoundExceptionkey was not found in the collection.

◆ Remove()

bool NanoByte.Common.Collections.XmlDictionary.Remove ( string  key)
inline

Removes all values assigned to this key.

Parameters
keyThe key to look for.
Returns
true if one or more elements were removed; otherwise, false.

◆ Sort()

void NanoByte.Common.Collections.XmlDictionary.Sort ( )
inline

Sorts all entries alphabetically by their key.

◆ ToDictionary()

IDictionary<string, string> NanoByte.Common.Collections.XmlDictionary.ToDictionary ( )

Convert this XmlDictionary to a Dictionary<TKey,TValue> for better lookup-performance.

Returns
A dictionary containing the same data as this collection.

The documentation for this class was generated from the following file: