Add method
Adds an element with the provided key and value to the user configuration dictionary.
The object to use as the key of the element to add.
The object to use as the value of the element to add.
Implementation
void Add(Object key, Object? value) {
_ValidateEntry(key, value);
if (_dictionary.containsKey(key)) {
// C# Dictionary.Add throws ArgumentException for a duplicate key.
throw ArgumentError.value(
key,
"key",
"An item with the same key has already been added",
);
}
_dictionary[key] = value;
Changed();
}