- key
- The key of the element to get or set.
The element with the specified key.
Type Reason ArgumentNullException key is null. NotSupportedException The property is set and the current instance is read-only.
The property is set, key does not exist in the collection, and the current instance has a fixed size.
When setting this property, if the specified key already exists in the current instance, the value is required to be replaced; otherwise, a new element is required to be created.