A serializable dictionary.
More...
Inherits SerializableDictionary, IDictionary< TKey, TValue >, and ISerializationCallbackReceiver.
|
void | Add (TKey key, TValue value) |
| Adds the specified key and value to the SerializableDictionary.
|
|
virtual void | Clear () |
| Removes all keys and values from the SerializableDictionary.
|
|
bool | ContainsKey (TKey key) |
| Determines whether the SerializableDictionary contains the specified key.
|
|
Dictionary< TKey, TValue >.Enumerator | GetEnumerator () |
| Returns an enumerator that iterates through the SerializableDictionary.
|
|
bool | Remove (TKey key) |
| Removes the value with the specified key from the SerializableDictionary.
|
|
void | Reset () |
| Resets the SerializableDictionary, clearing its internal dictionary.
|
|
void | Store () |
| Stores the SerializableDictionary's data into an array for serialization. This includes handling duplicates and null keys.
|
|
bool | TryGetValue (TKey key, out TValue value) |
| Gets the value associated with the specified key.
|
|
|
const string | EntryKeyPropertyPath = nameof(Entry.Key) |
| The property path for the key in the Entry structure.
|
|
const string | ItemsPropertyPath = nameof(_items) |
| The property path for the items in the SerializableDictionary.
|
|
|
int | Count [get] |
| Gets the number of key/value pairs contained in the SerializableDictionary.
|
|
bool | IsReadOnly [get] |
| Gets a value indicating whether the SerializableDictionary is read-only. This value is always false.
|
|
Dictionary< TKey, TValue >.KeyCollection | Keys [get] |
| Gets a collection containing the keys in the SerializableDictionary.
|
|
TValue | this[TKey key] [get, set] |
| Gets or sets the value associated with the specified key.
|
|
Dictionary< TKey, TValue >.ValueCollection | Values [get] |
| Gets a collection containing the values in the SerializableDictionary.
|
|
A serializable dictionary.
- Template Parameters
-
TKey | The type of the dictionary key. |
TValue | The type of the dictionary value. |
This class is not thread-safe.
◆ Add()
void Add |
( |
TKey |
key, |
|
|
TValue |
value |
|
) |
| |
Adds the specified key and value to the SerializableDictionary.
- Parameters
-
key | The key of the element to add. |
value | The value of the element to add. |
◆ ContainsKey()
bool ContainsKey |
( |
TKey |
key | ) |
|
Determines whether the SerializableDictionary contains the specified key.
- Parameters
-
key | The key to locate in the SerializableDictionary. |
- Returns
- true if the SerializableDictionary contains an element with the specified key; otherwise, false.
◆ Create< TKey, TValue >()
Creates a new serializable dictionary.
- Template Parameters
-
TKey | The type of the dictionary key. |
TValue | The type of the dictionary value. |
- Returns
- A new serializable dictionary.
◆ GetEnumerator()
Dictionary< TKey, TValue >.Enumerator GetEnumerator |
( |
| ) |
|
Returns an enumerator that iterates through the SerializableDictionary.
- Returns
- A Dictionary{TKey,TValue}.Enumerator structure for the SerializableDictionary.
◆ Remove()
Removes the value with the specified key from the SerializableDictionary.
- Parameters
-
key | The key of the element to remove. |
- Returns
- true if the element is successfully found and removed; otherwise, false. This method returns false if key is not found in the SerializableDictionary.
◆ TryGetValue()
bool TryGetValue |
( |
TKey |
key, |
|
|
out TValue |
value |
|
) |
| |
Gets the value associated with the specified key.
- Parameters
-
key | The key of the value to get. |
value | When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
- Returns
- true if the SerializableDictionary contains an element with the specified key; otherwise, false.
◆ Wrap()
Wraps an existing Dictionary into a SerializableDictionary.
- Parameters
-
dictionary | The Dictionary to be wrapped. |
- Returns
- A new SerializableDictionary that wraps the provided Dictionary.
◆ this[TKey key]
Gets or sets the value associated with the specified key.
- Parameters
-
key | The key of the value to get or set. |
- Returns
- The value associated with the specified key. If the specified key is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new element with the specified key.