Version

CacheKeys Property

Determines whether to use a dictionary to store the keys and objects.
Syntax
'Declaration
 
Protected Overridable ReadOnly Property CacheKeys As Boolean
protected virtual bool CacheKeys {get;}
Remarks

Returning true will make the collection try to use caching to store a dictionary of keys and objects.

This can greatly improve the performance of the collection; specifically the GetItem(String), Exists, and ValidateKeyDoesNotExist(String) methods. It has no effect on IndexOf(String,Boolean).

Caching will not work if AllowDuplicateKeys returns true.

This property should always return the same value. The return value should never change for the life of the collection.

When caching is enabled, if the derived class modifies the List directly, then it must call OnListChanged to notify the collection that the cached list needs to be rebuilt.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also