PostSharpAPI ReferencePost­Sharp.​Patterns.​CollectionsAdvisable­Dictionary<TKey, TValue>Set­Item
Open sandboxFocus

AdvisableDictionary<TKey, TValue>.SetItem Method

SetItem(TKey, TValue, TValue)

Sets the value with the specified key in the underlying dictionary.

protected virtual void SetItem(TKey key, TValue value, TValue oldValue)
Type Name Description
TKey key

The key of the element to add or replace.

TValue value

The new value to assign to the key.

TValue oldValue

The old value assigned to key, or null if there is currently no value assigned to key.


There is redundancy in requiring both key and oldValue, but this redundancy is required for performance reason.


This method does not cause the advices to be executed. It should be invoked only from inside the scope of the ExecuteWithAdvices method.