[This is preliminary documentation and is subject to change.]

Gets or sets the element with the specified key.

Namespace: Tools.CollectionsT.GenericT
Assembly: Tools (in Tools.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
public virtual TValue this[
	TKey key
] { get; set; }
Visual Basic
Public Overridable Default Property Item ( _
	key As TKey _
) As TValue
	Get
	Set
Visual C++
public:
virtual property TValue default[TKey key] {
	TValue get (TKey key);
	void set (TKey key, TValue value);
}
F#
abstract Item : 'TValue with get, set
override Item : 'TValue with get, set
JScript
JScript does not support indexed properties.

Parameters

key
Type: TKey
The key of the element to get or set.

Return Value

The element with the specified key.

Implements

IDictionary<(Of <(<'TKey, TValue>)>)>..::..Item[([( TKey])])

Exceptions

ExceptionCondition
System.Collections.Generic..::..KeyNotFoundExceptionThe property is retrieved and key is not found.
System..::..InvalidOperationExceptionLocked is True (in setter)
System..::..OperationCanceledExceptionOperation is canceled in eventhandler and CancelError is true
System..::..ExceptionAny Exception can be thrown by event handler of the ItemChanging event
System..::..ArgumentNullExceptionkey is null

See Also