AdvisableKeyedCollection<TKey, TItem>.Item Property (TKey) |
Gets or sets the element with the specified key.
Namespace: PostSharp.Patterns.Collections
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
public TItem this[ TKey key ] { get; set; }
Parameters
- key
- Type: TKey
The key of the element.
Return Value
Type: TItemThe element whose key is key.
Exception | Condition |
---|---|
ArgumentException | Thrown when the element whose key is key is not present or when the key of the new value is not identical to the value of the key parameter. |
When setting this property, the key of the new value should be identical to the value of the key parameter.