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

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

Syntax

C#
public virtual void Add(
	TKey key,
	TValue value
)
Visual Basic
Public Overridable Sub Add ( _
	key As TKey, _
	value As TValue _
)
Visual C++
public:
virtual void Add(
	TKey key, 
	TValue value
)
F#
abstract Add : 
        key:'TKey * 
        value:'TValue -> unit 
override Add : 
        key:'TKey * 
        value:'TValue -> unit 
JScript
public function Add(
	key : TKey, 
	value : TValue
)

Parameters

key
Type: TKey
Key of object being added
value
Type: TValue
The object to add to the DictionaryWithEvents<(Of <(<'TKey, TValue>)>)>.

Implements

IDictionary<(Of <(<'TKey, TValue>)>)>..::..Add(TKey, TValue)

Remarks

Note for inheritors: Call OnAdding(DictionaryWithEvents<(Of <<'(TKey, TValue>)>>)..::..CancelableKeyValueEventArgs) before adding an item to the list and OnAdded(DictionaryWithEvents<(Of <<'(TKey, TValue>)>>)..::..KeyValueEventArgs) after adding item to the list, do not forgot to check Cancel

Exceptions

ExceptionCondition
System..::..InvalidOperationExceptionLocked is True
System..::..OperationCanceledExceptionOperation is canceled in eventhandler and CancelError is true
System..::..ExceptionAny Exception can be thrown by event handler of the Adding event
System..::..ArgumentNullExceptionkey is null
System..::..ArgumentExceptionAn element with the same key already exists in the DictionaryWithEvents<(Of <(<'TKey, TValue>)>)>.

See Also